createNotificationChannel method

  1. @override
Future<TencentCloudChatPushResult> createNotificationChannel({
  1. required String channelID,
  2. required String channelName,
  3. String? channelDesc,
  4. String? channelSound,
})
override

Implementation

@override
Future<TencentCloudChatPushResult> createNotificationChannel({
  required String channelID,
  required String channelName,
  String? channelDesc,
  String? channelSound,
}) async {
  try {
    await _methodChannel.invokeMethod("createNotificationChannel", {
      "channel_id": channelID,
      "channel_name": channelName,
      "channel_desc": (channelDesc ?? ""),
      "channel_sound": (channelSound ?? ""),
    });
    return TencentCloudChatPushResult(code: 0);
  } on PlatformException catch (e) {
    return TencentCloudChatPushResult(
      code: int.tryParse(e.code) ?? -1,
      errorMessage: e.message,
    );
  }
}