The offline wake-up function allows your app to receive ringtone calls for audio and video calls while running in the background or in offline mode. TUICallKit Flutter relies on the push capabilities provided by manufacturers: Apple, Google, Vivo, and Xiaomi for message notifications.
Configure offline push
1. iOS
iOS platform's offline wake-up support for APNs and VoIP, please refer to the specific configuration process:
For the specific configuration process on the Android platform, please refer to: Offline Push (Flutter).
Customize offline message content
After the basic offline push configuration is successful, you can receive incoming call push notifications normally. If you need to customize the content of offline messages, you can use the params in the call and groupcall interfaces, and the TUIOfflinePushInfo to customize notification content, including title, content, and offline message ringtone. Specific usage as follows:
Modify the params in the call and groupcall interfaces, and set the TUIOfflinePushInfo.iOSSound for the offline message ringtone on the iOS platform.
2. Android
FCM
After completing step 1: Configure offline push, you can receive message push notifications even when offline, but it is the default ringtone. If you need to support custom ringtones, you need to perform the following operations:
1、In the IM console-basic configuration, select Android native offline push configuration -> select Google certificate for editing, add ChannelID, as shown in the following figure.
2、Add custom ringtone files to the android/app/src/main/res/raw/ directory of your project, such as "incoming_call.mp3".
3、After a successful login, use the tim_ui_kit_push_plugin plugin to register a NotificationChannel for playing custom ringtones to the Android system. Sample code as follows:
voidcreateNotificationChannel(){
AndroidNotificationChannelGroup group =newAndroidNotificationChannelGroup("GroupID","GroupName");