Send messages specifying the channelID to take effect with the custom ring tone. Refer to the following interface settings. For console settings, see the channelID field in the certificate. Only one of the two settings is needed.
restAPI
SDK API
Please refer to the restAPI interface, such as single push interface, with the following field example:
{
// ...
"OfflinePushInfo":{
"AndroidInfo":{
"OPPOChannelID":"test_OPPO_channel_id",
}
}
}
If you have integrated IM related products, please send messages using the setAndroidOPPOChannelID interface.
Mi
1 Log in to the manufacturer console to create channel and configuration, where the ring tone file needs to be added to the raw directory of your local Android Studio project.
Send messages specifying the channelID to take effect with the custom ring tone. Refer to the following interface settings. For console settings, see the channelID field in the certificate. Only one of the two settings is needed.
restAPI
SDK API
Please refer to the restAPI interface, such as single push interface, with the following field example:
Offline push notification sound settings (effective only for iOS), when `iOSSound = kIOSOfflinePushNoSound`, it indicates no sound will be played upon receiving.
When `iOSSound = kIOSOfflinePushDefaultSound`, it indicates the system sound will be played upon receiving.
To customize `iOSSound`, you first need to link the audio file into the Xcode project, and then set the audio filename (including the extension) to `iOSSound`.
iOS Custom Ringtone length cannot exceed 30s.
2. Set the AndroidSound field of OfflinePushInfo when sending messages. Pass the voice file name to AndroidSound.
restAPI
SDK API
Please refer to the restAPI interface, such as single push interface, with the following field example:
{
"OfflinePushInfo":{
"AndroidInfo":{
"Sound":"shake",// without suffix
"OPPOChannelID":"test_OPPO_channel_id",
"XiaoMiChannelID":"test_XiaoMi_channel_id",
"OPPOChannelID":"test_OPPO_channel_id",
"GoogleChannelID":"test_Google_channel_id"
},
"ApnsInfo":{
"Sound":"apns.mp3"
}
}
}
If you have integrated IM related products, please refer to sending messages.
Offline push notification sound settings (effective only for Android, supported only in imsdk 6.1 and above) are supported only on Huawei and Google phones for setting ringtone prompts.
To customize `AndroidSound`, you first need to place the audio file in the raw directory of the Android project, and then set the `AndroidSound` with the audio filename (without the extension).
Note:
The interface supports Huawei, Xiaomi, FCM, and APNS.
Custom ringtone resource files for Android should be added to the project's raw directory; for iOS, link them into the Xcode project.
Set the iOSSound and androidSound fields of offlinePushInfo when sending messages.
restAPI
SDK API
Please refer to the restAPI interface, such as single push interface, with the following field example:
{
// ...
"OfflinePushInfo":{
"AndroidInfo":{
"Sound":"shake",// without suffix
"OPPOChannelID":"test_OPPO_channel_id",
"XiaoMiChannelID":"test_XiaoMi_channel_id",
"OPPOChannelID":"test_OPPO_channel_id",
"GoogleChannelID":"test_Google_channel_id"
},
"ApnsInfo":{
"Sound":"apns.mp3"
}
}
}
If you have integrated im related products, set the offlinePushInfo's iOSSound and androidSound fields when calling sendMessage to send messages.
For specific manufacturer configurations, refer to the content of the Android and iOS modules. The methods to call are all named the same in the Flutter version of the IM SDK.