tencent cloud

Feedback

Last updated: 2024-03-12 14:51:07
    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

    iOS

    iOS platform's offline wake-up support for APNs and VoIP, please refer to the specific configuration process:

    Android

    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:
    Future<void> call(String userId, TUICallMediaType callMediaType, [TUICallParams? params])
    
    class TUICallParams {
    TUIOfflinePushInfo offlinePushInfo;
    }
    
    class TUIOfflinePushInfo {
    String? title;
    String? desc;
    bool? ignoreIOSBadge;
    String? iOSSound;
    String? androidSound;
    String? androidOPPOChannelID;
    int? androidVIVOClassification;
    String? androidXiaoMiChannelID;
    String? androidFCMChannelID;
    String? androidHuaWeiCategory;
    bool? isDisablePush;
    TUICallIOSOfflinePushType? iOSPushType;
    }}
    
    enum TUICallIOSOfflinePushType {
    APNs,
    VoIP,
    }

    Customize offline message ringtone

    iOS

    Modify the params in the call and groupcall interfaces, and set the TUIOfflinePushInfo.iOSSound for the offline message ringtone on the iOS platform.

    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:
    void createNotificationChannel() {
      AndroidNotificationChannelGroup group = new AndroidNotificationChannelGroup("GroupID", "GroupName");
    AndroidFlutterLocalNotificationsPlugin plugin = AndroidFlutterLocalNotificationsPlugin();
    plugin.createNotificationChannelGroup(group);
    
      AndroidNotificationChannel channel = AndroidNotificationChannel(
          "fcm_push_channel", "ChannelName",
          groupId: "GroupID",
          importance: Importance.high,
          enableLights: true,
          enableVibration: true,
          sound: RawResourceAndroidNotificationSound("incoming_call")); // Note: Media files do not need a suffix
      plugin.createNotificationChannel(channel);
    }
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support