updatePushNickname method
- String nickname
~english Updates the push display nickname of the current user.
This method can be used to set a push display nickname, the push display nickname will be used to show for offline push notification. When the app user changes the nickname in the user profile use ChatUserInfoManager.updateUserInfo be sure to also call this method to update to prevent the display differences.
Param nickname
The push display nickname, which is different from the nickname in the user profile.
Throws A description of the issue that caused this exception. See ChatError ~end
~chinese 更新推送通知收到时显示的昵称。
该昵称与用户信息中的昵称设置不同,我们建议这两种昵称的设置保持一致。更新用户属性昵称详见 ChatUserInfoManager.updateUserInfo。
Param nickname
推送通知收到时显示的昵称。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<void> updatePushNickname(String nickname) async {
Map req = {'nickname': nickname};
Map result =
await PushChannel.invokeMethod(ChatMethodKeys.updatePushNickname, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}