API | Description |
registerOnNotificationClickedEvent | Register message click callback in advance. |
registerPush | Register Push Service, optionally override the push message from interface parameter json. |
unRegisterPush | Unregister the offline push service when logging out of the IM account. |
API | Description |
configFCMPrivateRing | To configure the custom ringtone for FCM, it needs to be called before registering for the push service. |
API | Description |
setPushBrandId | To specify the vendor channel type for device offline push, it needs to be called before registering for the push service. |
getPushBrandId | Obtain the vendor channel type currently in use for device offline push. |
checkPushStatus | After completing the access configuration for each vendor, you can use this interface to test the push status on the corresponding vendor devices. |
setApnsCertificateID | Configure the push certificate ID for APNs separately. |
setApplicationGroupID | Configure the Application Group ID for the iOS project. |
getAndroidPushToken | Retrieve Android device manufacturer Token. |
setAndroidPushToken | Manually specify the Android device manufacturer Token. |
setAndroidCustomTIMPushConfigs | Manually replace the default push configuration file timpush-configs.json read by the plugin with a self-defined one. This needs to be invoked before registering the push service. |
registerPush
.void _onNotificationClicked({required String ext, String? userID, String? groupID}) { print("_onNotificationClicked: $ext, userID: $userID, groupID: $groupID"); /// Custom processing } TencentCloudChatPush().registerOnNotificationClickedEvent(onNotificationClicked: _onNotificationClicked);
Parameter | Type | Description | |
onNotificationClicked | ext | String | This is the complete ext information carried by the message, specified by the sender. If not specified, a default value is used. You can navigate to the corresponding page by resolving this field. |
| userID | String? | This parameter corresponds to userID, automatically attempts to parse the ext Json String, to retrieve the One-on-one Chat counterpart's userID within. Note: If you have not defined the ext field yourself, and it is set by default by the SDK or UIKit, you can use the default parsing here. If the attempt to parse fails, it will be null empty. |
| groupID | String? | This parameter corresponds to groupID, automatically attempts to parse the ext Json String, to retrieve the Group Chat groupID information within. Note: If you have not defined the ext field yourself, and it is set by default by the SDK or UIKit, you can use the default parsing here. If the attempt to parse fails, it will be null empty. |
TencentCloudChatPush().registerPush( onNotificationClicked: _onNotificationClicked, androidPushOEMConfig: "can be left null", apnsCertificateID: 0, );
Parameter | Type | Description | |
onNotificationClicked | ext | String | This is the complete ext information carried by the message, specified by the sender. If not specified, a default value is used. You can navigate to the corresponding page by resolving this field. |
| userID | String? | This parameter corresponds to userID, automatically attempts to parse the ext Json String, to retrieve the One-on-one Chat counterpart's userID within. Note: If you have not defined the ext field yourself, and it is set by default by the SDK or UIKit, you can use the default parsing here. If the attempt to parse fails, it will be null empty. |
| groupID | String? | This parameter corresponds to groupID, automatically attempts to parse the ext Json String, to retrieve the Group Chat groupID information within. Note: If you have not defined the ext field yourself, and it is set by default by the SDK or UIKit, you can use the default parsing here. If the attempt to parse fails, it will be null empty. |
androidPushOEMConfig | | String | If the timpush-configs.json configuration file has been imported, then this item can be left blank. The purpose of this item is to override the parameters in the json file, or to use it when the json file cannot be found
Optional Android-side parameters json:
|
apnsCertificateID | | int | If setApnsCertificateID method has already been called separately, this item can be omitted. |
TencentCloudChatPush().unRegisterPush();
TencentCloudChatPush().configFCMPrivateRing(channelId: channelId, ringName: ringName, enable: enable);
Parameter Name | Type | Description |
channelId | String | FCM channel custom notification bar's channel ID, unique within the app. |
ringName | String | FCM channel's custom push ringtone name, located in the raw directory and does not require a file suffix. |
enable | bool | Setting whether the offline push prompt ringtone uses a custom ringtone. |
TencentCloudChatPush().setPushBrandId(brandID: brandID);
Parameter | Description | |
brandID | Vendor | Device Type |
| XiaoMi | TencentCloudChatPushBrandID.XiaoMi |
| HuaWei | TencentCloudChatPushBrandID.HuaWei |
| FCM | TencentCloudChatPushBrandID.FCM |
| Meizu | TencentCloudChatPushBrandID.Meizu |
| Oppo | TencentCloudChatPushBrandID.Oppo |
| Vivo | TencentCloudChatPushBrandID.Vivo |
| Honor | TencentCloudChatPushBrandID.Honor |
final res = await TencentCloudChatPush().getPushBrandId(); if(res.code == 0){ final TencentCloudChatPushBrandID brandID = res.data; }
final res = await TencentCloudChatPush().checkPushStatus(brandID: 2002); if(res.code == 0){ final status = res.data; }
Parameter Name | Type | Description |
brandID | TencentCloudChatPushBrandID |
registerPush
.TencentCloudChatPush().setApnsCertificateID(apnsCertificateID: 0);
Parameter Name | Type | Description |
apnsCertificateID | int | The Certificate ID assigned to the APNs certificate in the Tencent Cloud IM Console. |
TencentCloudChatPush().setApplicationGroupID(applicationGroupID: "");
Parameter Name | Type | Description |
applicationGroupID | String | The format is: group + [Main Bundle ID] + key. |
TencentCloudChatPush().getAndroidPushToken();
TencentCloudChatPush().setAndroidPushToken(businessID: 10000, pushToken: "pushToken");
Parameter Name | Type | Description |
businessID | String | Push certificate ID, available from the Tencent Cloud IM console, under the push certificate card. |
pushToken | String | Obtain the vendor’s push Token in your own way. |
TencentCloudChatPush().setAndroidCustomTIMPushConfigs(configs: "");
Parameter Name | Type | Description |
configs | String | The name of the custom configuration file, the path must remain unchanged: "Engineering Root Directory/android/app/src/assets/". |
Was this page helpful?