You can replace the content of a notification a user has not opened yet by reusing a collapse identifier. This relies on the native mechanisms in iOS and Android, so behaviour differs slightly per platform. Add the parameter to your /createMessage or /createTargetedMessage request.
Parameters
- iOS —
apns_collapse_id: notifications with the sameapns_collapse_idreplace each other on the device, including a notification already shown in the notification centre. - Android —
android_collapse_key: FCM collapses messages with the same key while the device is offline, so the device receives only the latest one when it reconnects. A notification that has already been delivered and displayed is not swapped by the collapse key alone.
Example request
{
"request": {
"application": "XXXXX-XXXXX",
"auth": "YOUR_API_ACCESS_TOKEN",
"notifications": [
{
"send_date": "now",
"content": "This is the updated notification content",
"android_collapse_key": "update_id_123",
"apns_collapse_id": "update_id_123"
}
]
}
}
Web push
This feature is not available for web push. Browsers use their own tag parameter for replacement, but in the Pushwoosh API the tag field is reserved for audience segmentation.
Comments
0 comments
Please sign in to leave a comment.