Notification Object
This section outlines the Notification Object.
Notification Object Attributes
The fields listed in the table below will be returned in a JSON object when a successful request has been made.
Attribute | Data Type | Description |
---|---|---|
android_click_action | string | The action that is performed when a user taps the notification on Android devices. You must have an activity with a matching intent filter in your application. |
android_icon | string | The icon for the application notifications on Android devices. |
android_sound | string | The sound file included in the application that will play instead of the default device notification sound for Android devices. |
android_tag | string | Indicates whether each notification message results in a new entry on the notification center on Android devices. If not specified, each request creates a new notification. If specified and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification center. |
body | string | The notification body text. |
collapse_key | string | Identifies a group of messages that can be collapsed, so that only the last message gets sent when delivery can be resumed for Android devices. |
data | object | A custom data object that is passed back to the application. |
ios_badge | integer | The badge on the client application home icon used with iOS devices. If not specified, the badge is not changed. If set to 0, the badge is removed. |
ios_category | string | The notification type. It corresponds to the category payload of the aps dictionary. |
ios_collapse_id | string | Enables apns-collapse-id header key that allows the application to display only the last message of a group of messages with the same collapse key for iOS devices. |
ios_content_available | boolean | Defines if the support for the background update notification is enabled or not, allowing iOS to wake up the application in the background. It corresponds to the content-available payload of the aps dictionary. |
ios_mutable_content | integer | Defines if the content of the notification can be modified before the user device displays it. It corresponds to the mutable-content payload of the aps dictionary. |
ios_push_type | string | The type of the APNs push notification. This field enables the apns-push-type header key required for watchOS 6 and later, recommended for macOS, iOS, tvOS, and iPadOS. Values accepted in this field are: alert , background , complication , fileprovider , mdm , and voip . Refer to Apple documentation for more information on each push type. |
ios_sound | string | The sound file included in the application that will play instead of the default device notification sound for iOS devices. You must place the custom sound files in your application bundle or in the Library/Sounds folder of your application container directory before you can use them with notifications. |
ios_thread_id | string | The application-specific unique category identifier, which ensures that these notifications are differentiated from the rest and grouped together. |
ios_topic | string | The topic for the notification. It corresponds to the apns-topic key and usually looks like this: com.example.MyApp . |
notification_sid read only | string | The notification secure ID. |
partner_sid read only | string | The secure ID of the partner associated with the message. |
priority | string | The delivery priority for the notification. Values accepted in this field are: very_low , low , normal , high , and very_high . |
recipients | array | The list of devices secure IDs which will receive the notification. |
title | string | The notification title. |
ttl | integer | The time to live for the notification, measured in seconds. |
Sample Notification Object
{
"android_click_action": null,
"android_icon": null,
"android_sound": null,
"android_tag": null,
"body": "This is a test push notification for two registered devices.",
"collapse_key": null,
"data": {},
"ios_badge": null,
"ios_category": null,
"ios_collapse_id": null,
"ios_content_available": true,
"ios_mutable_content": null,
"ios_push_type": "alert",
"ios_sound": null,
"ios_thread_id": null,
"ios_topic": null,
"notification_sid": "d4f37407-f5ca-4242-891f-720efeae387b",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"priority": "normal",
"recipients": [
"901dd79e-ff4f-4ff3-9b48-c095dfb4fcef",
"16e64699-3064-463b-8dc7-96783c08a3d9"
],
"title": "Notification for two recipients",
"ttl": 60,
}