When Chatkit users miss a private message, they can receive it as a push notification. The message will appear as a push notification on their lock screen for iOS/Android applications or from their web browser. They can use these push notifications to launch the application or web browser tab and return to the conversation.
Chatkit push notifications rely on Chatkit presence to determine who should receive push notifications.
When a Chatkit user sends a message to another user — either in a private room with many users or just 1-1 — the Chatkit push notifications service checks whether the recipients are online.
If users in the private room are not online, a push notification is sent after 4 seconds. Another push notification is sent for each subsequent missed message. The iOS and Android operating systems will stack these notifications into a batch on the user’s lock screen.
The push notification payload combines fields which are determined by the operating system/browser with content from the Chatkit service.
Each push notification sent to Chatkit users includes:
app name— the name of your application (iOS/Android only)
app icon— the icon for your application
Chatkit room name— the name of the private room where the missed message occurred, as defined by your running Chatkit service
Chatkit message body— the first message part of type
text/plainfrom the missed message, automatically truncated with an … at 140 characters to adhere to operating system limits.
text/plainthen we will not send a notification for that message.
Chatkit push notifications are only enabled for devices which register to receive push notifications from your app.
If a user has already authorized push notifications for your app, the Chatkit client SDK will pass this device token to Chatkit once you follow the appropriate platform setup guide and a user updates their app to your latest version.
If a user has not yet authorized push notifications from your app, the Chatkit client SDK will trigger a system prompt once your have followed the platform setup guide and a user updates their app to your latest version.
If a user opts out of receiving push notifications from your app, they will not receive Chatkit push notifications until they go to their iOS, Android, or browser settings and opt back in to receive push notifications from your app.
Please see the guide on Customizing Push Notifications to learn how to change the content of Chatkit push notifications to suit your specific use case.