/ SDKs / .NET
SDKs
Chat SDKs .NET v4
Chat SDKs .NET
Chat SDKs
.NET
Version 4

Push notification content templates

Copy link

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

Copy link

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

Copy link
Text messageFile message

Default template

{sender_name}: {message}
An example can be Cindy: Hi!

{filename}
An example can be hello_world.jpg

Alternative template

New message arrived

New file arrived

To apply a template to push notifications, use the SetPushTemplate() method. Specify the type of template with the name as either default or alternative.

SendbirdChat.SetPushTemplate("default", inError =>
{
    if (inError != null)
        return; // Handle error.
});

To check the current user's push notification template, use the GetPushTemplate() method as follows.

SendbirdChat.GetPushTemplate((inTemplateName, inError) =>
{
    if (inError != null)
    {
        return; //Handle error.
    }

    if (inTemplateName == "default")
    {
        // The current user is using the default template.
    }
    else if (inTemplateName == "alternative")
    {
        // The current user is using the alternative template.
    }
});
On this page