Handle push notifications
When receiving the payload of the push notification sent to the notification channel, the channel_type
object can have the following values: messaging
, group_messaging
, notification_chat
, and notification_feed
. When the value is set to notification_chat
, the push notification needs to be displayed in Chat view. When the value is set to notification_feed
, the push notification needs to be displayed in Feed view. See the guide below on how to handle push notifications so that users can access either view of the notification channel upon tapping the push notification.
Note: The guides below show how to create view controllers for Feed view and Chat view. But you need to implement how to display each view controller depending on the layout of your app.
Prerequisite
To use delivery receipt in notification channels, Notification Service Extension
should be implemented in advance to receive the content of your remote notifications before they are displayed on the users' mobile devices, allowing the SDK to update the notification payload.
Requirements
To implement Notification Service Extension
to the iOS client app, create an App Group to combine your app and extension.
- Your app is developed with iOS 11.0 or later.
- A remote notification is implemented and configured to display an alert.
- The payload received from the remote notification includes the
mutable-content
key with the value set to 1.
Note: To enable
mutable-content
, go to the Settings > Application > Notifications > Push notification credentials on your dashboard. To learn more about the implementation and settings ofNotification Service Extension
, see the delivery receipt page in Chat SDK.
Feed view
When receiving a push notification, you can find the FEED_CHANNEL_URL
in the push notification payload. With the channel URL of the feed notification channel, you can create a view controller. Refer to the Notification channel page.
Chat view
When receiving a push notification, you can find the CHAT_NOTIFICATION_CHANNEL_URL
in the push notification payload. With the channel URL of the chat notification channel, you can create a view controller. Refer to the Notification channel page.