Native push
Note |
|---|
|
Property | Type | Description | ||
|---|---|---|---|---|
name | string | Unique name of the campaign (64 characters max). | ||
id | integer | read-only parameter Unique identifier of the campaign. | ||
audience | object | Optional. Specify which users will be targeted by this campaign (65535 bytes max, see Audience format). By default, all users will be targeted.
| ||
pushMode | string | Optional. Defines how the campaign is pushed. Valid values are:
Default value: one-shot | ||
payload | object | Native push payload as described in the Payload format. | ||
localization | object | Optional. Reach campaigns can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable property body. Example:
"localization": {
"en": {
"payload": {"badge": "+1", "alert":"My english push notification..."}
},
"fr": {
"payload": {"badge": "+1", "alert":"Ma notification de push français..."}
}
}
|
The format of the payload is the same as the one specified by Apple.
With the APS notification payload, you can include the following parameters: badge, alert, and sound. The payload can only be 256 bytes.
The badge is the number within a red circle that appears on an application’s home screen icon.
Apple requires an integer be sent as the badge value in the APS payload. However, Mobile Engagement provides a way to send increments and decrements of the badge value. The badge value is stored on our server, as an appInfo. The appInfo is named badge. You can update it using the Tag devices command or using the SDK’s sendAppInfo: function. Three types of auto badging can be used:
default: we will take the current stored badge value (badge appInfo) and insert that.
+X: we will take the badge appInfo value, increment by the number after the + sign, and also increment our stored badge by that number.
-X: same as above, except that we decrement instead of increment.
Simple message with an increment of the badge value:
{
"name": "MyNativePush",
"payload": {"badge": "+1", "alert":"Hello"}
}
Custom payload using the default badge value:
{
"name": "MyNativePush",
"payload": {"aps": {"badge": "default", "alert":"Hello"}, "acme" : "foo"}
}
Two types of Windows Phone push notifications are currently supported:
toast
tile
The final payload cannot exceed 32 kilobytes (the API will return an error if the payload is too big).
A toast in MPNS can have two texts: text1 and text2. text1 is the title of the notification, and text2 is the content. At least one this field is required. The toast texts must be specified in a toast field inside a JSON object.
Example toast with both text1 and text2:
{
"toast": {
"text1":"Hello",
"text2":"World"
}
}
To send a tile notification, set the JSON tile field with the xml data of the tile as a string.
Example:
{
"tile":
"<wp:Notification xmlns:wp='WPNotification'><wp:Tile><wp:Count>2</wp:Count><wp:Title>Hello World</wp:Title></wp:Tile></wp:Notification>"
}
You can combine a toast and a tile notification in a single native push campaign. You just need to set the two fields: tile and toast in the JSON object.
Example:
{
"toast": {
"text1":"Hello World"
},
"tile": "<wp:Notification xmlns:wp='WPNotification'><wp:Tile><wp:Count>2</wp:Count><wp:Title>Hello World</wp:Title></wp:Tile></wp:Notification>"
}
