RC’s push notification template feature supports multi-language notifications and Xiaomi app package name settings:
-
Multi-language push notifications: The server matches the push content in the specified language from the template based on the language set by the user in the client SDK, then sends a remote push notification.
-
App package name push notifications: For Xiaomi vendor push notifications, you can set channel IDs for different app package names. In group chats, if members are under different app package names, you can push messages using different Xiaomi channel IDs for each package name.
- Starting from version 5.0.0, the client SDK supports specifying a push notification template when sending a message.
- Users need to set their push notification language in the client SDK. Otherwise, the server defaults to the push notification language set at the App Key level.
1. Multi-language push notification templates
Create a multi-language push notification template
Before using the push notification template feature, create a multi-language push template in the RC developer console.
- Go to the Custom Push Copy page in the console to create a template. You can create up to 100 templates.
- Push notification template ID: The unique identifier for the template. Enter this ID when sending a message with the template.
- Push notification template name: Name your template.
- Push notification content settings: Each template supports multiple languages, with each language having a push title and content.
- Add push content. Set the push title and content for each language identifier. For example, the
asia
template can include copy for zh_CN, zh_TW, zh_HK, ja_JP, and ko_KR.
- Language identifier: Select a language identifier, like en_US, to add copy for that language.
- Push notification title: Set the notification bar title for the language. This is optional—defaults to the username for one-to-one chats and the group name for group chats. Note: The push title specified when sending a message overrides the template title.
- Push notification content: Set the notification bar content for the language. Note: The push content specified when sending a message overrides the template content.
The template takes effect 15 minutes after setup.
Use a custom push notification template
The client SDK supports specifying a template ID (templateId
) in the MessagePushConfig
property when sending a message. If the message triggers a push notification, the server will push content based on the multi-language settings in the template.
If the recipient client has set a push notification language, the server matches the user-reported language from the template for remote push. If the user hasn’t set a language or it can’t be matched, the server uses the default push notification language for the App on RC.
When setting the push notification language in the client SDK, the language identifier must match the one in the developer console. For example, if the client sets the language to en-US but the template uses en_US, the match will fail.
-
For details on specifying the push notification template ID (
templateId
), refer to the client SDK documentation:Note: To use the push notification template feature, leave the push title and content in the message push notification attributes blank.
-
For details on setting the push notification language in the client, refer to the client SDK documentation:
- Android 5.X
- iOS 5.X
- Web does not have a corresponding API.
You can also modify the default push notification language for your App Key in RC. If needed, submit a ticket to request changes to the push notification language at the App Key level.
2. App package name push notifications
Since Xiaomi push notification channel IDs must be applied for and can’t be customized, in group chats where members are under different app package names, you may need to use different channel IDs to push messages:
- Example: A, B, and C are users under different app package names of the same AppKey but are in the same group. The group contains IM messages and audio/video notifications. For the same message type, different channel IDs are applied for under different app package names. Use the push notification template feature to set the channel IDs for each package name and specify the corresponding template ID when sending group messages.
When adding a template, select “App package name push notification” for the template type:
Click “Add template content” to set the channel IDs for different app package names:
The template takes effect 15 minutes after setup.
- For details on specifying the push notification template ID (
templateId
), refer to the client SDK documentation: