setAndroidPushToken method

  1. @override
Future<TencentCloudChatPushResult> setAndroidPushToken({
  1. required String businessID,
  2. required String pushToken,
})
override

Implementation

@override
Future<TencentCloudChatPushResult> setAndroidPushToken({
  required String businessID,
  required String pushToken,
}) async {
  try {
    await _methodChannel.invokeMethod("setAndroidPushToken", {
      "business_id": businessID,
      "push_token": pushToken,
    });
    return TencentCloudChatPushResult(code: 0);
  } on PlatformException catch (e) {
    return TencentCloudChatPushResult(
      code: int.tryParse(e.code) ?? -1,
      errorMessage: e.message,
    );
  }
}