isLoginBefore method

Future<bool> isLoginBefore()

~english Checks whether the user has logged in before and did not log out.

If you need to check whether the SDK is connected to the server, please use isConnected.

Return Whether the user has logged in before. true: The user has logged in before, false: The user has not logged in before or has called the logout method. ~end

~chinese 检查用户是否已登录 Chat 服务。

Return 用户是否已经登录 Chat 服务。

  • true:是;
  • false:否。 ~end

Implementation

Future<bool> isLoginBefore() async {
  Map result =
      await ClientChannel.invokeMethod(ChatMethodKeys.isLoggedInBefore);
  try {
    EMError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.isLoggedInBefore);
  } on EMError catch (e) {
    throw e;
  }
}