Native push

 
System_CAPS_noteNote
  • Native push campaigns are only available for iOS and Windows Phone applications.

  • Native push campaigns will use the one shot push mode by default. In this mode, the campaign will be delivered only to your existing users (campaign will stop after that).

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.

System_CAPS_noteNote

If you set pushMode property to manual, the only thing you can specify in the audience is the push quota filter.

pushMode

string

Optional. Defines how the campaign is pushed. Valid values are:

  • one-shot : In this mode, the campaign will be delivered only to your existing users (campaign will stop after that).

  • manual : Windows Phone only. In this mode, the campaign will not be pushed automatically to devices. You will have to use the Push campaign command to push the campaign to your end-users. Campaigns can be pushed multiple times to the same device.

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:

  1. default: we will take the current stored badge value (badge appInfo) and insert that.

  2. +X: we will take the badge appInfo value, increment by the number after the + sign, and also increment our stored badge by that number.

  3. -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:

  1. toast

  2. 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>"
}
Show: