bindDeviceToken method

Future<void> bindDeviceToken({
  1. required String notifierName,
  2. required String deviceToken,
})

~english bind the push token.

Param token The push token.

Throws A description of the issue that caused this exception. See EMError ~end

~chinese 更新推送 token。

Param token 要更新的推送 token。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError。 ~end

Implementation

Future<void> bindDeviceToken(
    {required String notifierName, required String deviceToken}) async {
  try {
    Map req = {'notifierName': notifierName, 'deviceToken': deviceToken};
    Map result = await Client.instance.pushManager
        .callNativeMethod(ChatMethodKeys.bindDeviceToken, req);
    EMError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}