iOS 10 has introduced rich push notifications which provides the capability to add image, video, audio, or GIF attachments to your push notifications.
Rich push notifications are enabled via a notification service extension, a separate and distinct binary embedded in your app bundle. Prior to displaying a new push notification, the system will call your notification service extension to modify the payload as well as add media attachments to be displayed.
The following section covers how to enable rich push notifications:
- Enable push notifications for your app.
- To create a notification service extension in your project, in Xcode, select File > New > Target.
- Choose the Notification Service Extension template.
- When sending notifications via APNs, include the mutable-content flag in your app payload.
This key must be present in the app payload or the system will not call your app extension.
When using the CleverTap Dashboard to send rich push notifications:
- Select the Advanced checkbox.
- Select the Mutable Content checkbox.
- Add your custom key-value pair(s).
When using the CleverTap Server API to send push: include "mutable-content": "true" in the platform_specific: iOS section of the request payload.
Below are some project examples:
Updated about 1 year ago