User-Level Push Configuration
User-level push configuration refers to the push settings for the currently logged-in user of the App.
Note
- User-level push configuration is different from App Key-level push configuration. App Key-level push configuration applies to all users under the App. You can adjust some App Key-level push service configurations in the Console.
- User-level push configuration requires that the App Key has enabled the User-Level Feature Settings. To enable this, please submit a ticket.
Set User Push Language Preference
Set the display 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 change to "[File]".
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
.
API Description
Method:
Future<int> changePushLanguage(
String language,
)
Example Call:
int? code = await engine?.changePushLanguage(
language,
);
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
Parameter | Type | Description |
---|---|---|
language | String | Set the display language for push notifications. Currently, RC supports zh_CN , en_US , and ar_SA for built-in push languages. For custom push languages, please ensure consistency with the language identifier in Console > Custom Push Templates. |
Currently, RC supports simplified Chinese zh_CN
, American English en_US
, and Arabic ar_SA
for built-in push languages.
You can also modify the default push language configuration for the App Key in RC by navigating to RC Console, then Configuration > Chat settings > Basic features > Push > Push Language.
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.
API Description
Class: RCIMIWEngine
Method:
Future<int> changePushContentShowStatus(
bool showContent,
)
Example Call:
int? code = await IMEngineManager().engine?.changePushContentShowStatus(
showContent,
);
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
Parameter | Type | Description |
---|---|---|
showContent | bool | Whether to display push details. true, display details false, do not display details, the push notification will show "You have received a notification". |
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 the configurations for some platforms:
- Android:
Message
's MessagePushConfig property. Refer to the MessagePushConfig Property Description in the Android "Send Message" documentation. - iOS:
RCMessage
's RCMessagePushConfig property. Refer to the Configure Message Push Properties section in 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 for 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 not display push content details by default.
Set User Multi-Device Push Preference
Set whether the offline mobile device should receive push notifications when the user is online on the Web or PC for the currently logged-in user. 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 in the Basic Features page of the Console.
- 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 preferences.
- If the App Key has enabled Web/PC Online Mobile Push, the currently logged-in user can turn this behavior on or off.
API Description
Method
Future<int> changePushReceiveStatus(
bool receive,
)
Example Call:
int? code = await engine?.changePushReceiveStatus(
receive,
);
Parameter Description
Parameter | Type | Description |
---|---|---|
receive | bool | Whether the mobile device should receive push notifications when other devices are online true, receive push false, do not receive push |