Skip to main content

Custom Multilingual Push Notification Templates

RongCloud supports multilingual push notifications through the push notification template feature. The server will match the corresponding language push notification content from the specified push notification template based on the push notification language reported by App users through the client, and then send remote notifications.

tip
  • Client SDK supports specifying a push notification template when sending messages starting from version 5.0.0.
  • App users need to set the language for receiving push notifications through the client SDK, otherwise the server will default to using the App Key level Push Language setting to match push notification content for them.

Create Multilingual Push Notification Templates

Before using the push notification template feature, you must create multilingual push notification templates in RongCloud Console.

  1. Visit the Console Custom Push Notification Content page to create push notification templates. You can create up to 100 templates.

    (width=800)

    • Push Notification Template ID: The unique identifier of the push notification template. When sending messages, if using this push notification template, you need to fill in this template ID.
    • Push Notification Template Name: Set the name of the push notification template.
    • Push Notification Content Settings: Each push notification template supports setting push notification content for multiple languages, with each language corresponding to one push notification title and one push notification content.
  2. Add push notification content. You can set corresponding push notification titles and content by Language Identifier one by one. For example, template asia can simultaneously add corresponding content for multiple languages such as zh_CN, zh_TW, zh_HK, ja_JP, ko_KR, etc.

    (width=600)

    • Language Identifier: Select a Language Identifier from the dropdown menu, such as en_US, to add content that matches that language.
    • Push Notification Title: Set the notification bar title for the corresponding language. Optional parameter, defaults to username for one-to-one chat, group name for group chat and ultra group. Please note that the push notification title specified when sending messages will override the title in the template, causing the title set in the push notification template to not take effect.
    • Push Notification Content: Set the notification bar display content for the corresponding language. Please note that the push notification content specified when sending messages will override the content in the template, causing the content set in the push notification template to not take effect.

Templates take effect 15 minutes after creation.

Use Custom Push Notification Templates

Client SDK supports passing in template ID (templateId) in the message Push Notification Attributes configuration MessagePushConfig when sending messages, to enable the specified multilingual push notification template for the message. After setting, if the message triggers push notifications, the server will push according to the multilingual content in the specified push notification template.

If the receiving client has set a push notification language, the server will match the push notification language reported by the user from the push notification template for remote notifications. If the user has not set it, or cannot match the user's push notification language, the server will push according to the default push notification language content of the App on RongCloud server.

When the client SDK sets the language for receiving push notifications, the Language Identifier needs to be consistent with the Language Identifier in the Console to match successfully. For example, if the client sets the push notification language to American English en-US, but the American English representation in the push notification template is en_US, it cannot match successfully.

tip
  • For how to specify push notification template ID (templateId), see Configure Message Push Notification Attributes. Note that if you need to use the push notification template feature, please leave the push notification title and push notification content in Message Push Notification Attributes empty.
  • For how the client sets the language for receiving push notifications, see User-level Push Notification Configuration > Push Notification Language.
  • You can modify the default push notification language configuration of App Key in RongCloud. If needed, please submit a ticket to apply for changing the App Key level Push Language.