Skip to main content

Sending custom data in push notification payloads

When sending requests to the Atomic Platform, you can send an optional notificationDetail object as part of the API request payload.

The notificationDetail object allows you to define data to be sent by Atomic in the push notification payload. You use this data to decide which action to take in your host app when a user taps on an Atomic push notification, such as navigating to a particular screen or section.

Size Limit

To support both iOS and Android, the push notification payload itself has a size limit of 2KB. This should be considered when determining the data to include in the notificationDetail object.

{
"flows": [
{
"payload": {
"options": {},
"variables": {
"flaggedBy": "Joe Bloggs"
},
"notificationDetail": {
"businessId": "ABCD1234"
},
"target": {...}
}
}
]
}

The Atomic iOS and Android SDKs include a method to detect push notifications originating from Atomic - notificationFromPushPayload. You pass the push notification payload from the host app to this method, and it will return:

  • null or nil if the push notification payload did not originate from Atomic;
  • Otherwise, a structured object, containing:
    • the custom data in the push notification payload (sent in notificationDetail above);
    • the ID of the stream container that triggered the notification;
    • the card instance ID that the notification pertains to.

For more information on using this feature in the SDKs, see the relevant documentation for iOS and Android.