updateFCMPushToken method
~english Updates the FCM push token,
Param token The FCM push token.
Throws A description of the issue that caused this exception. See ChatError
~end
~chinese 更新谷歌 FCM 推送 token。
Param token 要更新的谷歌 FCM 推送 token。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。
~end
Implementation
@Deprecated("Use [bindDeviceToken] instead")
/// ~english
/// Updates the FCM push token,
///
/// Param [token] The FCM push token.
///
/// **Throws** A description of the issue that caused this exception. See [ChatError]
/// ~end
///
/// ~chinese
/// 更新谷歌 FCM 推送 token。
///
/// Param [token] 要更新的谷歌 FCM 推送 token。
///
/// **Throws** 如果有异常会在此抛出,包括错误码和错误信息,详见 [ChatError]。
/// ~end
Future<void> updateFCMPushToken(String token) async {
try {
Map req = {'token': token};
Map result = await platform_interface.Client.instance.pushManager
.callNativeMethod(ChatMethodKeys.updateFCMPushToken, req);
ChatError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}