NIMLoginManager Protocol Reference

Conforms to NSObject
Declared in NIMLoginManagerProtocol.h

Overview

登录协议

– login:token:completion: required method

登录

- (void)login:(NSString *)account token:(NSString *)token completion:(NIMLoginHandler)completion

Parameters

account

帐号

token

令牌 (在后台绑定的登录token)

completion

完成回调

Discussion

登录

Declared In

NIMLoginManagerProtocol.h

– autoLogin:token: required method

自动登录

- (void)autoLogin:(NSString *)account token:(NSString *)token

Parameters

account

帐号

token

令牌 (在后台绑定的登录token)

Discussion

自动登录

启动APP如果已经保存了用户帐号和令牌,建议使用这个登录方式,使用这种方式可以在无网络时直接打开会话窗口

Declared In

NIMLoginManagerProtocol.h

– autoLogin: required method

自动登录

- (void)autoLogin:(NIMAutoLoginData *)loginData

Parameters

loginData

自动登录参数

Discussion

自动登录

启动APP如果已经保存了用户帐号和令牌,建议使用这个登录方式,使用这种方式可以在无网络时直接打开会话窗口

Declared In

NIMLoginManagerProtocol.h

– logout: required method

登出

- (void)logout:(nullable NIMLoginHandler)completion

Parameters

completion

完成回调

Discussion

登出

用户在登出是需要调用这个接口进行 SDK 相关数据的清理,回调 Block 中的 error 只是指明和服务器的交互流程中可能出现的错误,但不影响后续的流程。 如用户登出时发生网络错误导致服务器没有收到登出请求,客户端仍可以登出(切换界面,清理数据等),但会出现推送信息仍旧会发到当前手机的问题。

Declared In

NIMLoginManagerProtocol.h

– kickOtherClient:completion: required method

踢人

- (void)kickOtherClient:(NIMLoginClient *)client completion:(nullable NIMLoginHandler)completion

Parameters

client

当前登录的其他客户端

completion

完成回调

Discussion

踢人

Declared In

NIMLoginManagerProtocol.h

– currentAccount required method

返回当前登录帐号

- (NSString *)currentAccount

Return Value

当前登录帐号,如果没有登录成功,这个地方会返回空字符串""

Discussion

返回当前登录帐号

Declared In

NIMLoginManagerProtocol.h

– isLogined required method

当前登录状态

- (BOOL)isLogined

Return Value

当前登录状态

Discussion

当前登录状态

Declared In

NIMLoginManagerProtocol.h

– currentAuthMode required method

当前 SDK 鉴权模式

- (NIMSDKAuthMode)currentAuthMode

Return Value

当前 SDK 鉴权模式

Discussion

当前 SDK 鉴权模式

Declared In

NIMLoginManagerProtocol.h

– currentLoginClients required method

返回当前登录的设备列表

- (nullable NSArray<NIMLoginClient*> *)currentLoginClients

Return Value

当前登录设备列表 内部是NIMLoginClient,不包括自己

Discussion

返回当前登录的设备列表

Declared In

NIMLoginManagerProtocol.h

– addDelegate: required method

添加登录委托

- (void)addDelegate:(id<NIMLoginManagerDelegate>)delegate

Parameters

delegate

登录委托

Discussion

添加登录委托

Declared In

NIMLoginManagerProtocol.h

– removeDelegate: required method

移除登录委托

- (void)removeDelegate:(id<NIMLoginManagerDelegate>)delegate

Parameters

delegate

登录委托

Discussion

移除登录委托

Declared In

NIMLoginManagerProtocol.h