Class PushNotificationRequest
See here for an overview of push notifications within Sensus. The PushNotificationRequest class represents push notification requests submitted to the RemoteDataStore for processing by the push notification backend. See the examples for the JSON format of such requests.
Inheritance
Namespace: Sensus.Notifications
Assembly: SensusAndroid.dll
Syntax
public class PushNotificationRequest : Object
Constructors
PushNotificationRequest(String, String, Protocol, PushNotificationUpdate, PushNotificationRequestFormat, DateTimeOffset, Guid)
Initializes a new instance of the PushNotificationRequest class. The intent of this instance will be to deliver a PushNotificationUpdate to the app. This update does not necessarily have any user-targeted content.
Declaration
public PushNotificationRequest(string id, string deviceId, Protocol protocol, PushNotificationUpdate update, PushNotificationRequestFormat format, DateTimeOffset notificationTime, Guid backendKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Identifier of the request. To update a previously issued request, submit a new request with the same identifier. |
System.String | deviceId | Identifier of target device. |
Protocol | protocol | Target protocol. |
PushNotificationUpdate | update | Update. |
PushNotificationRequestFormat | format | Format. |
System.DateTimeOffset | notificationTime | Time to deliver the notification. |
System.Guid | backendKey | Backend storage key. It is reasonable to supply a new System.Guid for each PushNotificationRequest instance. |
PushNotificationRequest(String, String, Protocol, String, String, String, PushNotificationRequestFormat, DateTimeOffset, Guid)
Initializes a new instance of the PushNotificationRequest class. The intent of this instance will be to deliver user-targeted information to the device in the form of a notification with a message title, body, etc.
Declaration
public PushNotificationRequest(string id, string deviceId, Protocol protocol, string title, string body, string sound, PushNotificationRequestFormat format, DateTimeOffset notificationTime, Guid backendKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Identifier of the request. To update a previously issued request, submit a new request with the same identifier. |
System.String | deviceId | Identifier of target device. |
Protocol | protocol | Target protocol. |
System.String | title | Title. |
System.String | body | Body. |
System.String | sound | Sound. |
PushNotificationRequestFormat | format | Format. |
System.DateTimeOffset | notificationTime | Time to deliver the notification. |
System.Guid | backendKey | Backend storage key. It is reasonable to supply a new System.Guid for each PushNotificationRequest instance. |
Properties
BackendKey
Declaration
public Guid BackendKey { get; }
Property Value
Type | Description |
---|---|
System.Guid |
DeviceId
Declaration
public string DeviceId { get; }
Property Value
Type | Description |
---|---|
System.String |
JSON
Declaration
public JObject JSON { get; }
Property Value
Type | Description |
---|---|
Newtonsoft.Json.Linq.JObject |
LocalFormat
Gets the local format used by the device for push notifications.
Declaration
public static PushNotificationRequestFormat LocalFormat { get; }
Property Value
Type | Description |
---|---|
PushNotificationRequestFormat | The local format. |
Protocol
Declaration
public Protocol Protocol { get; }
Property Value
Type | Description |
---|---|
Protocol |
Methods
GetAzureFormatIdentifier(PushNotificationRequestFormat)
Gets the Azure format identifier for the native push notification service.
Declaration
public static string GetAzureFormatIdentifier(PushNotificationRequestFormat format)
Parameters
Type | Name | Description |
---|---|---|
PushNotificationRequestFormat | format | Format. |
Returns
Type | Description |
---|---|
System.String | The Azure format identifier. |