NIMLoginManager Protocol Reference

Conforms to NSObject
Declared in NIMLoginManagerProtocol.h

Overview

Login protocol

– login:token:completion: required method

Login

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

Parameters

account

account

token

The token for login

completion

Completion callback

Discussion

Login

Declared In

NIMLoginManagerProtocol.h

– autoLogin:token: required method

Automatic login

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

Parameters

account

account

token

The token for login

Discussion

Automatic login

If the user account and token is saved, this login method is recommended, which can directly open the session window without network access

Declared In

NIMLoginManagerProtocol.h

– autoLogin: required method

Automatic login

- (void)autoLogin:(NIMAutoLoginData *)loginData

Parameters

loginData

automatic login parameter

Discussion

Automatic login

If the user account and token is saved, this login method is recommended, which can directly open the session window without network access

Declared In

NIMLoginManagerProtocol.h

– logout: required method

Logout

- (void)logout:(nullable NIMLoginHandler)completion

Parameters

completion

Completion callback

Discussion

Logout

The user must call this interface to clean up the SDK related data when logging out. The error in the callback block only indicates the possible errors in the interaction process with the server, and does not affect the subsequent process. If a network error occurs when the user logs out and the server does not receive the logout request, the client can still log out (switching interface, and clearing data), but push notifications will still be sent to the current mobile phone.

Declared In

NIMLoginManagerProtocol.h

– kickOtherClient:completion: required method

Kick logins on other clients

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

Parameters

client

Other logged in clients

completion

Completion callback

Discussion

Kick logins on other clients

Declared In

NIMLoginManagerProtocol.h

– currentAccount required method

Return the current login account

- (NSString *)currentAccount

Return Value

the current login account. If the login failes, this method will return an empty string “”

Discussion

Return the current login account

Declared In

NIMLoginManagerProtocol.h

– isLogined required method

Current login status

- (BOOL)isLogined

Return Value

Current login status

Discussion

Current login status

Declared In

NIMLoginManagerProtocol.h

– currentAuthMode required method

Current SDK authentication mode

- (NIMSDKAuthMode)currentAuthMode

Return Value

current SDK authentication mode

Discussion

Current SDK authentication mode

Declared In

NIMLoginManagerProtocol.h

– currentLoginClients required method

Return the current login device list

- (nullable NSArray<NIMLoginClient*> *)currentLoginClients

Return Value

The current login device list is NIMLoginClient, excluding the current device

Discussion

Return the current login device list

Declared In

NIMLoginManagerProtocol.h

– queryServerTimeCompletion: required method

query the server time.

- (void)queryServerTimeCompletion:(NIMLoginGetServerTimeHandle)completion

Parameters

completion

Completion callback

Discussion

query the server time.

This interface has a rate limit. If the call fails, the last time is returned by default.

Declared In

NIMLoginManagerProtocol.h

– addDelegate: required method

Add a login delegate

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

Parameters

delegate

login delegate

Discussion

Add a login delegate

Declared In

NIMLoginManagerProtocol.h

– removeDelegate: required method

Remove a login delegate

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

Parameters

delegate

login delegate

Discussion

Remove a login delegate

Declared In

NIMLoginManagerProtocol.h