Skip to main content

User-Level Push Notification Configuration

User-level push notification configuration refers to the push notification settings for the currently logged-in user of the App.

tip
  • User-level push notification configuration is different from App Key-level push notification configuration. App Key-level push notification configuration applies to all users under the App. You can adjust some App Key-level push service configurations in the Console.
  • User-level push notification configuration requires that the App Key has enabled the User-Level Feature Settings. To enable this feature, please submit a ticket.

Set User Push Language Preference

Set the language preference for push notifications for the currently logged-in user. If the user has not set a preference, the Push Language setting at the App Key level will be used.

RC's built-in message types include default push content with formatted text strings. For example, by default, when a user receives a file message in a one-to-one chat, the push notification content will display the simplified Chinese string "[文件]". If the user changes their push language preference to American English en_US, the formatted text string in the notification content will be "[File]" when they receive a file message.

The "[文件]" and "[File]" in the example above are formatted text strings. Currently, RC's server provides formatted text strings for the push content of built-in message types, supporting Simplified Chinese zh_CN, American English en_US, and Arabic ar_SA.

Interface Description

Class: RCIMIWEngine

Method: changePushLanguage( language: string, callback: IRCIMIWChangePushLanguageCallback ): Promise<number>;

Example Call


const callback = {
onPushLanguageChanged: (code: number) => {
//...
},
};
let code = await engine.changePushLanguage(language, callback);

After successful setup, when the current user receives push notifications for built-in message types, the formatted text strings in the push content will be adjusted according to the corresponding language.

Parameter Description

ParameterTypeDescription
languagestringPush language, currently only supports en_us, zh_cn, ar_sa
callbackIRCIMIWChangePushLanguageCallbackCallback for the interface call result.

Set User Push Notification Detail Preference

By default, push notification content is displayed if the user has not set a preference. This feature allows the currently logged-in user to set whether the content details of push notifications should be displayed.

Interface Description

Class: RCIMIWEngine

Method: changePushContentShowStatus( showContent: boolean, callback: IRCIMIWChangePushContentShowStatusCallback ): Promise<number>;

Example Call


const callback = {
onPushContentShowStatusChanged: (code: number) => {
//...
},
};
let code = await engine.changePushContentShowStatus(showContent, callback);

If set to not display details, the push notification will show the formatted text string "You have received a notification" (this formatted text string supports Simplified Chinese zh_CN, American English en_US, and Arabic ar_SA).

Parameter Description

ParameterTypeDescription
showContentbooleanWhether to display remote push content
callbackIRCIMIWChangePushContentShowStatusCallbackCallback for the interface call result.

Please note that when sending a message, you can specify forceShowDetailContent to override the recipient's configuration and force the display of push notification content details. Below are some platform configurations:

  • Android: Message's MessagePushConfig property. Refer to the MessagePushConfig Property Description in the Android "Send Message" documentation.
  • iOS: RCMessage's RCMessagePushConfig property. Refer to Configuring Message Push Properties under the iOS "APNs Push Development Guide".
  • Web: IPushConfig
  • IM Server API: If the interface provides the forceShowPushContent parameter, this feature is supported.

You can also modify the default configuration of the App Key in RC. If needed, please submit a ticket to change the App Key-level Push Notification Details. Once turned off, all push notifications will default to not displaying push content details.

Set User Multi-Device Push Notification Preference

Set whether the currently logged-in user's offline mobile devices should receive push notifications when they are online on the Web or PC. Please note that this interface is only available if the App Key has enabled the Web/PC Online Mobile Push service.

You can modify the App Key-level configuration on the Console's Basic Features page.

  • If the App Key has not enabled Web/PC Online Mobile Push, all App users will not receive push notifications on their offline mobile devices when they are online on the Web or PC. App users cannot modify their own preferences.
  • If the App Key has enabled Web/PC Online Mobile Push, the currently logged-in user can turn this behavior on or off themselves.

Interface Description

Class: RCIMIWEngine

Method: changePushReceiveStatus( receive: boolean, callback: IRCIMIWChangePushReceiveStatusCallback ): Promise<number>;

Example Call


const callback = {
onPushReceiveStatusChanged: (code: number) => {
//...
},
};
let code = await engine.changePushReceiveStatus(receive, callback);

Parameter Description

ParameterTypeDescription
receivebooleanWhether to receive
callbackIRCIMIWChangePushReceiveStatusCallbackCallback for the interface call result.