Push notifications
How can I implement push notifications?
- iOS
- Create your certificate signing request
- Create your push notification SSL certificate
- Export your .p12 file and upload to SendBird Dashboard
- Do not provide an export password on your .p12 certificate.
- Register a device token to SendBird server. It includes our iOS sample code.
- Android
- Generate server key and sender ID for FCM
- Register server key to SendBird Dashboard
- Set up your Android FCM client app
- Register a device token to the SendBird server. It includes our Android sample code.
Can’t receive the push notification?
Check your push notification setting turned on (https://dashboard.sendbird.com >Application > Notification Tab).
- Did you correctly register APNS/FCM credentials?
- Did a user generate a correct device token using the right certification and senderID?
- Did a user correctly register device token via your app?
- You can check a user device token here: https://dashboard.sendbird.com > Users >(search a user with ID or nickname) > check > Push Token
- Is a user in a group channel (not an open channel)?
- Is a user offline at that time?
- Did you check a user/channel push notification preference option?
- User’s power save mode may delay a push notification.
Push notification flow?
Suppose that sender and receivers are in the same group channel.
- Suppose that you register APNS/FCM credential (https://dashboard.sendbird.com >Application > Notification Tab)
- Suppose that the users in the group channel are offline.
How to (un)register a device token?
Whenever a user connects to SendBird, register the device token.
- When the user logs out of your app and before the user removes your app, unregister the device token.
- If you don’t want to use multi-device tokens (Only a current user on a device can use push notifications), unregister the current token and register the new device token with unique = True.
Snooze / Do not disturb option?
Read this blog post on implementing snooze and do not disturb.
- Push notifications trigger option matrix
What is the message length limit of push messages?
The standard push notification message length limit(iOS and Android) is 4KB. However, we add some additional payloads to the push notification. The additional payloads depend on your message variable, such as the message text field, data field, etc. So, it’s not exactly 4KB (it’s less than 4KB).
Multi-device tokens best practice?
- You must store and manage the device tokens yourself (device_id | device_token).
- Whenever a user connects to SendBird, register the device token.
- When the user logs out of your app and before the user removes your app, unregister the device token.
- You can make the user notification settings to manage himself (register/unregister device tokens using SendBird SDK methods)
Beyond push notifications
if you are interested in 1-way omnichannel communication beyond notifications, check Sendbird Business Messaging, Sendbird's omnichannel business notification solution spanning WhatsApp, SMS, and In-app notifications.