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
| Property | Type | Description |
|---|---|---|
| disableNotification | bool | Hide notification title in the notification bar |
| disablePushTitle | bool | Hide push title (iOS only) |
| pushTitle | String | Custom push title (highest priority) |
| pushContent | String | Custom push content (highest priority) |
| pushData | String | Additional push data |
| forceShowDetailContent | bool | Force display push content, overriding client DND settings |
| iOSPushOptions | IOSPushOptions | iOS-specific push options |
| androidPushOptions | AndroidPushOptions | Android-specific push options |
| templateId | String | Push template ID for multi-language push |
| voIPPush | bool | Use VoIP push channel for iOS |
| harmonyPushOptions | HarmonyPushOptions | HarmonyOS-specific push options |
iOSPushOptions
| Property | Type | Description |
|---|---|---|
| threadId | String | Notification grouping ID (iOS 10+) |
| category | String | Rich push type identifier |
| apnsCollapseId | String | Notification collapse ID (iOS 10+, max 64 bytes) |
| richMediaUri | String | Rich push content URL |
| interruptionLevel | String | Notification interruption level (e.g., active, passive) |
androidPushOptions
| Property | Type | Description |
|---|---|---|
| notificationId | String | Unique push ID (Xiaomi, Huawei) |
| channelIdMi | String | Xiaomi channel ID |
| channelIdHW | String | Huawei channel ID |
| channelIdOPPO | String | OPPO channel ID |
| pushTypeVIVO | VivoPushType | VIVO push type |
| collapseKeyFCM | String | FCM notification group ID |
| imageUrlFCM | String | FCM notification icon URL |
| importanceHW | HuaweiPushImportance | Huawei message priority |
| imageUrlHW | String | Huawei 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 |