User-level push notification configuration
User-level push notification configuration refers to push settings that apply to the currently logged-in user of the app.
-
User-level push configuration is distinct from App Key-level push configuration. App Key-level configuration applies to all users under the app. You can adjust some App Key-level push service settings in the Nexconn console.
-
User-level push configuration requires the User-Level Feature Settings to be enabled for the App Key. To enable it, submit a ticket.
Set the user's push notification language preference
You can set the display language for push notifications. Once set, format text strings in push notification content for built-in message types are adjusted according to the specified locale for the current user.
If the user has not set a preference, the App Key-level Push notification language setting is used.
Built-in Nexconn message types include format text strings in their default push notification content. For example, by default, when a user receives a push notification for a file message in a direct Channel, the notification displays the Simplified Chinese string "[文件]". If the user changes their push language preference to US English en_US, the format text string in subsequent file message notifications becomes "[File]".
The "[文件]" and "[File]" strings in the example above are format text strings. The Nexconn server currently provides format text strings for built-in message type push notifications in Simplified Chinese zh_CN, US English en_US, and Arabic ar_SA.
Method signature
- (void)setPushLanguageCode:(NSString *)language
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(NCError *error))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| language | NSString | The language to display in push notifications. Nexconn's built-in supported push languages are zh_CN, en_US, and ar_SA. For custom push languages, use the same language identifier as set in Console > Custom Push Copy. |
| successBlock | Block | Callback invoked when the push language is set successfully. |
| errorBlock | Block | Callback invoked when setting the push language fails. Returns an NCError in error. |
Example
// Review required: no public iOS Chat SDK API was found for this operation.
Nexconn's built-in supported push languages are Simplified Chinese zh_CN, US English en_US, and Arabic ar_SA. Use the Custom Multi-Language Push Template feature alongside this setting to support additional push languages in a single push notification.
You can also change the default push language for an App Key in the Nexconn console under Chat > Chat settings > Offline Push > Push notification language.
Set the user's push notification content display preference
Use updateShowPushContentStatus: to control whether push notification content details are displayed for the current user.
Method signature
- (void)updateShowPushContentStatus:(BOOL)isShowPushContent
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(NCError *error))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| isShowPushContent | BOOL | Whether to display the push notification content details (YES to show; NO to hide). When set to hide, push notifications display the format text string "You have received a notification" (supported in Simplified Chinese zh_CN, US English en_US, and Arabic ar_SA). |
| successBlock | Block | Callback invoked when the setting is applied successfully. |
| errorBlock | Block | Callback invoked when the setting fails. Returns an NCError in error. |
Example
// Review required: no public iOS Chat SDK API was found for this operation.
Note that when sending a message, you can specify the push notification content for that message via NCSendMessageParams.pushContent, and disable push notifications for the message via NCMessage.disableNotification.
You can also change the App Key-level default configuration in Nexconn. To change the App Key-level Push Notification Details setting, submit a ticket. Once disabled, all push notifications default to hiding notification content details.
Set the user's multi-Device push notification preference
Configure whether offline mobile devices should receive push notifications when the current logged-in user is active on Web or PC. This interface is only available after Send to mobiles when web/PC online is enabled for the App Key.
You can modify the App Key-level configuration on the Chat settings page in the console under Chat > Chat settings > Offline Push.
- If Send to mobiles when web/PC online is not enabled for the App Key, mobile devices that are offline will not receive push notifications while the user is active on Web or PC. App users cannot modify this behavior themselves.
- If Send to mobiles when web/PC online is enabled for the App Key, the current logged-in user can turn this behavior on or off.
Method signature
- (void)setPushReceiveStatus:(BOOL)receiveStatus
success:(nullable void (^)(void))successBlock
error:(nullable void (^)(NCError *error))errorBlock;
Parameters
| Parameter | Type | Description |
|---|---|---|
| receiveStatus | BOOL | Whether the mobile device receives push notifications when the Web client is online (YES to receive; NO to not receive). |
| successBlock | Block | Callback invoked when the setting is applied successfully. |
| errorBlock | Block | Callback invoked when the setting fails. Returns an NCError in error. |
Example
// Review required: no public iOS Chat SDK API was found for this operation.