updateHMSPushToken method

  1. @Deprecated("Use [bindDeviceToken] instead")
Future<void> updateHMSPushToken(
  1. String token
)

Updates the HMS push token.

Param token The HMS push token.

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

Implementation

@Deprecated("Use [bindDeviceToken] instead")

///
/// Updates the HMS push token.
///
/// Param [token] The HMS push token.
///
/// **Throws** A description of the issue that caused this exception. See [ChatError]
///
///
///
Future<void> updateHMSPushToken(String token) async {
  if (Platform.isAndroid) {
    try {
      Map req = {'token': token};
      Map result = await platform_interface.Client.instance.pushManager
          .callNativeMethod(ChatMethodKeys.updateHMSPushToken, req);
      ChatError.hasErrorFromResult(result);
    } catch (e) {
      rethrow;
    }
  } else {
    return;
  }
}