Skip to main content

Configure message push properties

Customize push notification behavior for individual messages by setting the pushConfig property on SendMessageParams (or SendMediaMessageParams) when sending.

Code example

Dart
final channel = DirectChannel('<target-user-id>');
await channel.sendMessage(
SendMessageParams(
messageParams: TextMessageParams(
text: '<message-content>',
),
pushConfig: PushConfig(
disableNotification: false,
pushContent: '<push-content>',
pushData: '<push-data>',
androidPushOptions: AndroidPushOptions(),
iOSPushOptions: IOSPushOptions(),
),
),
callback: SendMessageCallback(
onMessageSent: (code, message) {
if (code == null) print('Message sent');
},
),
);

PushConfig properties

PropertyTypeDescription
disableNotificationboolHide notification title in the notification bar
disablePushTitleboolHide push title (iOS only)
pushTitleStringCustom push title (highest priority)
pushContentStringCustom push content (highest priority)
pushDataStringAdditional push data
forceShowDetailContentboolForce display push content, overriding client DND settings
iOSPushOptionsIOSPushOptionsiOS-specific push options
androidPushOptionsAndroidPushOptionsAndroid-specific push options
templateIdStringPush template ID for multi-language push
voIPPushboolUse VoIP push channel for iOS
harmonyPushOptionsHarmonyPushOptionsHarmonyOS-specific push options

iOSPushOptions

PropertyTypeDescription
threadIdStringNotification grouping ID (iOS 10+)
categoryStringRich push type identifier
apnsCollapseIdStringNotification collapse ID (iOS 10+, max 64 bytes)
richMediaUriStringRich push content URL
interruptionLevelStringNotification interruption level (e.g., active, passive)

androidPushOptions

PropertyTypeDescription
notificationIdStringUnique push ID (Xiaomi, Huawei)
channelIdMiStringXiaomi channel ID
channelIdHWStringHuawei channel ID
channelIdOPPOStringOPPO channel ID
pushTypeVIVOVivoPushTypeVIVO push type
collapseKeyFCMStringFCM notification group ID
imageUrlFCMStringFCM notification icon URL
importanceHWHuaweiPushImportanceHuawei message priority
imageUrlHWStringHuawei notification icon URL

| categoryHW | String | Huawei notification category | | categoryVivo | String | VIVO notification category | | importanceHonor | HonorPushImportance | Honor notification importance level | | imageUrlHonor | String | Honor notification icon URL | | channelIdFCM | String | FCM channel ID |