bindDeviceToken method

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

bind the push token.

Param token The push token.

Throws A description of the issue that caused this exception. See ChatError

Implementation

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