Skip to main content

Configuring Push Notification Attributes for Messages

You can provide [RCMessagePushConfig] configuration when sending messages to customize push behavior for individual messages. For example:

  • Customize push title and notification content
  • Customize notification bar icons
  • Add remote push additional information
  • Bypass recipient client configurations to forcibly display notification content
  • Other personalized configurations supported by APNs, HarmonyOS or Android push channels

Compared to the pushContent and pushData parameters in message sending inputs, configurations in MessagePushConfig have higher priority. When sending messages, if RCMessagePushConfig is configured, its settings will take precedence.

RCTextMessage *txtMsg = [RCTextMessage messageWithContent:@"Test text message"];

RCMessage *message = [[RCMessage alloc]
initWithType:ConversationType_PRIVATE
targetId:@"targetId"
direction:MessageDirection_SEND
content:txtMsg];

RCMessagePushConfig *pushConfig = [[RCMessagePushConfig alloc] init];
pushConfig.disablePushTitle = NO;
pushConfig.pushTitle = @"Notification Title";
pushConfig.pushContent = @"Notification Content";
pushConfig.pushData = @"Notification pushData";
pushConfig.templateId = @"templateId";
pushConfig.iosConfig.threadId = @"iOS notification grouping ID";
pushConfig.iosConfig.apnsCollapseId = @"iOS notification replacement ID";
pushConfig.iosConfig.richMediaUri = @"URL for custom iOS notification bar icon";
pushConfig.androidConfig.notificationId = @"Android notification ID";
pushConfig.androidConfig.channelIdMi = @"Xiaomi channelId";
pushConfig.androidConfig.channelIdHW = @"Huawei channelId";
pushConfig.androidConfig.categoryHW = @"Huawei Category";
pushConfig.androidConfig.channelIdOPPO = @"OPPO channelId";
pushConfig.androidConfig.typeVivo = @"vivo classification";
pushConfig.androidConfig.categoryVivo = @"vivo Category";
pushConfig.hmosConfig.imageUrl = "HarmonyOS notification bar large icon URL";
pushConfig.hmosConfig.category = "HarmonyOS push message category";
pushConfig.forceShowDetailContent = YES;
message.messagePushConfig = pushConfig;

/// Call IMKit or IMLib message sending methods

Message Push Attribute Specifications

RCMessagePushConfig provides the following parameters:

ParameterTypeDescription
disablePushTitleBOOLWhether to block notification titles (only effective for iOS targets). Android third-party push platforms require notification titles, so this is currently unsupported.
pushTitleNSStringPush title (highest priority). If unset, refer to [User Content Message Formats] for default push notification titles and contents of built-in message types.
pushContentNSStringPush content (highest priority). If unset, refer to [User Content Message Formats] for default push notification titles and contents of built-in message types.
pushDataNSStringRemote push additional information. If empty, uses the message's pushData
forceShowDetailContentBOOLWhether to forcibly display notification details. When recipients configure "don't show message details" via RCPushProfile's - (void)updateShowPushContentStatus:(BOOL)isShowPushContent success:(void (^)(void))successBlock error:(void (^)(RCErrorCode status))errorBlock, this parameter can override that setting
templateIdNSStringPush template ID. Matches language settings configured via SDK RCPushProfile's setPushLauguageCode. Uses default content if no match. Configure templates in "Console > Custom Push Content".
iOSConfigRCiOSConfigiOS platform configurations. See RCiOSConfig Attributes.
androidConfigRCAndroidConfigAndroid platform configurations. See RCiOSConfig Attributes.
hmosConfigRCHarmonyOSConfigHarmonyOS platform configurations. See RCHarmonyOSConfig Attributes.
  • RCiOSConfig Attributes

    ParameterTypeDescription
    threadIdNSStringiOS notification grouping ID (same threadId groups notifications, iOS10+)
    apnsCollapseIdNSStringiOS notification replacement ID (notifications with same apnsCollapseId replace older ones, max 64 bytes, iOS10+)
    richMediaUriNSStringCustom iOS notification bar icon URL (app must implement display). Requirements: 120*120px, PNG/JPG. Supported since SDK v5.2.4.
    interruptionLevelNSStringFor iOS15+. Values: passive, active (default), time-sensitive, or critical. See APNs interruption-level. Helps ensure important notifications (e.g., balance changes) bypass system "Scheduled Summary" and "Focus Modes". Supported since SDK v5.6.7.
  • RCAndroidConfig Attributes

ParameterTypeDescription
notificationIdNSStringUnique identifier for Android platform push notifications. Currently supported on Xiaomi and Huawei push platforms. By default, developers do not need to set this - when a message generates a push notification, the message's messageUId is used as the notificationId.
channelIdMiNSStringXiaomi channel ID. The push channel used for this message on Xiaomi devices. If developers have integrated Xiaomi Push and need to specify a channelId, they should obtain it from Android developers (channelId is created by developers themselves).
miLargeIconUrlNSString(This field is no longer functional as Xiaomi has officially discontinued support) URL for the notification image used in Xiaomi push notifications. Image requirements: 120*120px, PNG or JPG format.
Supported since version 5.1.7. Compatible with MIUI China edition (requires MIUI 12+) and global edition.
channelIdHWNSStringHuawei channel ID. The push channel used for this message on Huawei devices. If developers have integrated Huawei Push and need to specify a channelId, they should obtain it from Android developers (channelId is created by developers themselves).
hwImageUrlNSStringURL for the custom small notification icon on the right side of Huawei push notifications. If not set, no icon will be displayed. Icon file must be smaller than 512 KB. Recommended specifications: 40dp x 40dp with 8dp rounded corners. Icons exceeding recommended size may be compressed or incompletely displayed.
Supported since version 5.1.7.
categoryHWNSStringHuawei push message self-classification identifier, empty by default. Value must be uppercase letters (e.g., IM). This field becomes effective after the app completes [Huawei Self-Classification Rights Application] or [Special Permission Application] per Huawei requirements. See Huawei's official documentation [Huawei Message Classification Standards]. This field takes precedence over the Huawei Push Category configured in the Console under the App Key's Application Identifier. Supported since SDK version 5.4.0.
importanceHWRCImportanceHwHuawei push notification priority level. RCImportanceHwLow indicates silent notification (no sound/vibration). RCImportanceHwNormal indicates strong notification (with sound/vibration). Actual device behavior depends on categoryHW value, Console-configured category, or [Huawei Smart Classification] results. Supported since SDK version 5.1.3.
imageUrlHonorNSStringURL for the custom large notification icon on the right side of Honor push notifications. If not set, no icon will be displayed. Icon file must be smaller than 512 KB. Recommended specifications: 40dp x 40dp with 8dp rounded corners. Icons exceeding recommended size may be compressed or incompletely displayed. Supported since SDK version 5.6.7.
importanceHonorRCimportanceHonorHonor push notification category for Android, determining user device notification behavior. RCImportanceHonorLow indicates marketing/news messages. RCImportanceHonorNormal (default) indicates service/communication messages. Supported since SDK version 5.6.7.
typeVivoNSStringVIVO push service message type. Options: 0 (marketing messages) and 1 (system messages). Corresponds to VIVO's classification field. See [VIVO Push Message Classification Guide].
categoryVivoNSStringVIVO push service message sub-category (e.g., IM for instant messages). Corresponds to VIVO's category field. See [VIVO Push Message Classification Guide] for valid values. If specifying categoryVivo, must also specify typeVivo (system/marketing message). Ensure content complies with VIVO's official requirements. This field takes precedence over the VIVO Push Category configured in the Console under the App Key's Application Identifier. Supported since SDK version 5.4.2.
channelIdOPPONSStringOPPO channel ID. The push channel used for this message on OPPO devices. If developers have integrated OPPO Push and need to specify a channelId, they should obtain it from Android developers (channelId is created by developers themselves).
fcmCollapseKeyNSStringFCM push notification group ID. Supported since SDK version 5.1.3. Note: When using this field, ensure the Console's FCM push configuration uses Notification Message mode.
fcmImageUrlNSStringURL for the notification icon on the right side of FCM push notifications. If not set, no icon will be displayed. Supported since SDK version 5.1.3. Note: When using this field, ensure the Console's FCM push configuration uses Certificate authentication and Notification Message mode.
fcmChannelIdNSStringFCM channel ID. The push channel used for this message via FCM. If developers have integrated FCM Push and need to specify a channelId, they should obtain it from Android developers (channelId is created by developers themselves).

Channel IDs need to be created by Android developers as follows:

Push ServiceConfiguration Instructions
HuaweiCreate Channel ID via Android SDK API on app side
XiaomiCreate Channel ID on Xiaomi Developer Platform or via Xiaomi server API
OPPOCreate Channel ID via Android SDK on app side; register same Channel ID on OPPO Developer Platform
vivoCreate Channel ID via server API
  • RCHarmonyOSConfig Attributes

    ParameterTypeDescription
    imageUrlNSStringURL for the large notification icon on the right side of HarmonyOS notifications. Supported formats: PNG, JPG, JPEG, HEIF, GIF, BMP. Image dimensions (length*width) must be <25,000 pixels. Notifications won't display if image requirements aren't met.
    categoryNSStringHarmonyOS push message category (empty by default). Value must be uppercase letters. See HarmonyOS category documentation for details.