login method

Future<void> login(
  1. String username,
  2. String pwdOrToken, [
  3. bool isPassword = true
])

An app user logs in to the chat server with a password or token.

Param username The username.

Param pwdOrToken The password or token.

Param isPassword Whether to log in with password or token. true: (default) Log in with password. false: Log in with token.

Throws A description of the exception. See {@link EMError}.

Implementation

Future<void> login(String username, String pwdOrToken,
    [bool isPassword = true]) async {
  await EMClient.getInstance.login(username, pwdOrToken, isPassword);
}