updatePushNickname method Null safety

Future<void> updatePushNickname(
  1. String nickname
)

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 {@link EMUserInfoManager#updateOwnInfo(EMUserInfo, int?) 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 {@link EMError}

Implementation

Future<void> updatePushNickname(String nickname) async {
  Map req = {'nickname': nickname};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.updatePushNickname, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}