User-Level Push Notification Configuration
User-level push configuration refers to push settings for the currently logged-in user of the app, configured through [RCCoreClient sharedCoreClient].pushProfile.
- User-level push configuration differs from App Key-level push configuration. App Key-level settings apply to all users under the app. You can adjust some App Key-level push service configurations in the RC Console.
- User-level push configuration requires the App Key to have User-Level Feature Settings enabled. To enable this feature, please submit a ticket.
Set User Push Language Preference
You can set the display language preference for push notifications. Once configured, when the current user receives push notifications for built-in message types, the format text strings in the push content will be adjusted according to the selected language. When no user preference is set, the App Key-level Push Language setting will be used.
Default push content for RC's built-in message types contains format text strings. For example, when receiving a file message push in a one-to-one chat, the notification will display "[文件]" in Simplified Chinese by default. If the user changes their push language preference to American English en_US, the format text string will appear as "[File]" for subsequent file messages.
The "[文件]" and "[File]" in the above example are format text strings. Currently, RC's server provides format text strings for built-in message push content, supporting Simplified Chinese zh_CN, American English en_US, and Arabic ar_SA.
Method Signature
- (void)setPushLanguageCode:(NSString *)language
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(RCErrorCode status))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| lauguage | NSString | Sets the display language for push notifications. Currently supported built-in push languages are zh_CN, en_US, and ar_SA. For custom push languages, ensure consistency with language identifiers in Console > Custom Push Content. |
| successBlock | Block | Callback for successful push language setting |
| errorBlock | Block | Callback for failed push language setting. Returns error code RCErrorCode in status. |
Example Code
[[RCCoreClient sharedCoreClient].pushProfile setPushLanguageCode:@"zh_CN" success:^{
} error:^(RCErrorCode status) {
}];
RCPushLauguage lauguage = [RCIMClient sharedRCIMClient].pushProfile.pushLauguage;
Currently supported built-in push languages are Simplified Chinese zh_CN, American English en_US, and Arabic ar_SA. Apps can combine this with the Custom Multilingual Push Template feature to support more push languages in a single notification.
You can also modify the default push language configuration for your App Key in the RC Console under Chat > Chat settings > Offline Push > Push notification language.
Set User Push Notification Detail Preference
Use updateShowPushContentStatus: to configure whether push notifications should display content details.
Method Signature
- (void)updateShowPushContentStatus:(BOOL)isShowPushContent
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(RCErrorCode status))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| isShowPushContent | BOOL | Whether to display push content details (YES: show; NO: hide). When disabled, notifications will show the format text string "You received a notification" (supported in zh_CN, en_US, and ar_SA). |
| successBlock | Block | Callback for successful detail display setting. |
| errorBlock | Block | Callback for failed detail display setting. Returns error code RCErrorCode in status. |
Example Code
[[RCCoreClient sharedCoreClient].pushProfile updateShowPushContentStatus:NO success:^{
} error:^(RCErrorCode status) {
}];
BOOL isShowPushContent = [RCCoreClient sharedCoreClient].pushProfile.isShowPushContent;
Note that message senders can override this setting by specifying forceShowDetailContent to forcibly display push content details. Platform-specific implementations:
- Android:
Message's MessagePushConfig property. See MessagePushConfig Description in Android's "Sending Messages" documentation. - iOS:
RCMessage's RCMessagePushConfig property. See Configuring Message Push Attributes under iOS's "APNs Push Development Guide". - Web: IPushConfig
- Harmony: PushConfig
- IM Server API: Supported when interfaces provide the
forceShowPushContentparameter.
You can also modify the default configuration at the App Key level. To change the App Key-level Push Notification Details setting, please submit a ticket. When disabled, all push notifications will hide content details by default.
Set Multi-Device Push Receipt Preference
Configures whether offline mobile devices should receive push notifications when the user is online via Web or PC clients. Note: This feature requires the App Key to have Web/PC Online Mobile Push Receipt enabled.
You can modify App Key-level settings in the Console's Feature Configuration page.
- If Web/PC Online Mobile Push Receipt is disabled for the App Key, mobile devices won't receive pushes when users are online via Web/PC. App users cannot modify this behavior.
- If enabled, logged-in users can toggle this preference individually.
Method Signature
- (void)setPushReceiveStatus:(BOOL)receiveStatus
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(RCErrorCode status))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| receiveStatus | BOOL | Whether mobile devices should receive pushes when Web client is online (YES: receive; NO: don't receive). |
| successBlock | Block | Callback for successful preference setting. |
| errorBlock | Block | Callback for failed preference setting. Returns error code RCErrorCode in status. |
Example Code
[[RCCoreClient sharedCoreClient].pushProfile setPushReceiveStatus:YES success:^{
} error:^(RCErrorCode status) {
}];
BOOL receiveStatus = [RCCoreClient sharedCoreClient].pushProfile.receiveStatus;