Enabling push notifications, snooze, and do not disturb in Sendbird
Push notifications are essential for any app with chat and messaging because users receive messages from people they care about, about topics highly relevant to them, or from interactions they value. Users participate in conversations for good reasons and they don’t want to miss a message. The need for push notifications only increases if a user is responsible for reading and responding to a message as in, for example, work settings. Our guide to mobile push notifications has everything you need to know about push notifications, their benefits, and how they can be used.
Take customer relationships to the next level.
It is now a common standard to give users options to control when they receive push notifications. In fact, users expect it. As users try to balance the utility of notifications with setting boundaries around them, users now expect to set up “Do not disturb” statuses, snooze notifications, or control when they receive a push notification.
Push notification preferences in SendBird
Sendbird has three categories of options for push notifications:
- General options for users and channels – these allow your users to control when they receive push notifications
- Snooze – allows the user to suspend notifications for a set a period
- Do not disturb – allows users to routinely suspend notifications for set periods each day
Push notification preferences, aka ‘Push Trigger Options’
Sendbird allows your users to set preferences for push notifications using two dimensions:
- User preference
- Group channel preference
Sendbird calls these general options for push notifications, “Push Trigger Options.”
Push notification preferences for users
There are three user options available for setting push notification preferences. Note that the Sendbird documentation refers to these as Push Trigger Options.
- ‘all’ : User receives push notifications for all new messages while offline, including mentioned messages
- ‘off’ : User does not receive any push notifications
- ‘mention_only’ : User receives push notifications only for messages in which the user is mentioned
Push notification options for Group Channels
Please note that options for push notifications are only available in group channels. They are not available for open channels.
There is one additional group channel preference compared to the user preferences described in the last section: default. Note that the SendBird documentation refers to these as Push Trigger Options.
- ‘all’ : User receives push notifications for all new messages in this channel while offline, including mentioned messages
- ‘off’ : User does not receive any push notifications for any messages in this channel
- ‘mention_only’ : User receives push notifications only for messages in which the user is mentioned in this channel
- ‘default’: The user’s push notification preferences applies to this channel
References for general push notification options
See our documentation for further reference:
Option to snooze push notifications
In SendBird’s parlance, to ‘Snooze’ push notifications means the user does not receive any notifications for a specific period of time, which has a user-defined start and end. This period does not repeat.
Please note that Snooze is only a user option and not a group channel option. A user’s Snooze setting will override any other user or channel push preferences during the Snooze period.
You can enable the option to ‘Snooze’ in the client app or from Platform API. The start- and end-time are in Unix Milliseconds, or 13-digit numbers.
References for snooze
See additional references for setting a snooze on notifications:
Options for ‘Do not disturb’
In Sendbird’s parlance, to set a ‘Do not disturb’ (DND) means that the user routinely does not receive any notifications at certain times of the day. These periods repeat every day.
Note that DND is a user option and not an option for group channels. A user’s DND setting will routinely override any user or channel preferences for push notifications during the set period of time.
You can enable DND in the client app or from Platform API. The start- and end-time are expressed as integers: start_hour and start_min, end_hour and end_min.
References for ‘Do not disturb’
See our references for setting a ‘Do not disturb’ on notifications:
Setting push preferences at the message level
SendBird also gives you an option to set the push notification preference at the message level.
Both text and file messages have an optional Boolean property, send_push, that allows you to toggle on or off a push notification for a message. It defaults to being on, or True.
You can read more about the send_push optional message property in the Platform API documentation here.
How Sendbird applies notification preferences
Given many options for notifications, it’s important to understand how the options are applied and what results from the combination of user, group channel, and other options.
Basically, you enable push notification preferences at the message, user, and group channel level. DND and Snooze, if in effect, always supersede Trigger Options (at the user and group channel level).
The following flow chart gives you the permissions hierarchy in granular detail.
User controls for push notifications are now standard
Thanks to the proliferation of messenger apps and chat collaboration software, user options for controlling push notifications are now a standard feature, more or less expected by users. Sendbird’s SDKs and Platform API enable you to easily build these features for your users and deliver the excellent messaging experience they’ve come to expect.