Push notification content templates
Push notification content templates are pre-formatted forms that can be customized to display your own push notification messages on a user’s device. Sendbird provides two types: default and alternative. Both templates can be customized in Settings > Application > Notifications > Push notification content templates on Sendbird Dashboard.
Content templates
There are two types of push notification content template: default and alternative. Default template applies to users with the initial notification message setting. Alternative template is used when a user selects a different notification content template instead of the default template.
Whereas the content of the template is set at the application level, individual users can choose which type of template to use through the Chat Platform API.
Note: When a custom channel type has its own customized push notification content template, it ignores both default and alternative templates.
Both templates can be customized using the variables of sender_name
, filename
, message
, channel_name
, and file_type_friendly
, which are replaced with corresponding string values. As for file_type_friendly
, it indicates the type of file sent, such as audio, image, and video.
See the following table to learn how to use content templates.
List of content templates
Text message | File message | |
---|---|---|
Default template | {sender_name}: {message} | {filename} |
Alternative template |
|
|
To apply a template to push notifications, use the SetPushTemplate()
method. Specify the type of template with the name as either default
or alternative
.
To check the current user's push notification template, use the GetPushTemplate()
method as follows.