loginIM static method

  1. @Deprecated('请使用loginIMWithResult')
Future<bool> loginIM(
  1. String accountId,
  2. String token, {
  3. NIMLoginOption? option,
})

登录IM

Implementation

@Deprecated('请使用loginIMWithResult')
static Future<bool> loginIM(String accountId, String token,
    {NIMLoginOption? option}) async {
  //初始化在线状态监听
  if (IMKitConfigCenter.enableOnlineStatus) {
    SubscriptionManager.instance.init();
  }
  //初始化联系人全局缓存
  getIt<ContactProvider>().init();
  final result =
      await getIt<IMLoginService>().loginIM(accountId, token, option: option);
  if (result.isSuccess) {
    AIRobotManager.instance.init();
  }
  return result.isSuccess;
}