AgoraChatSDK 1.2.0
Instance Methods | Class Methods | Protected Attributes | Properties | List of all members
AgoraChatClient Class Reference

#import <AgoraChatClient.h>

Inheritance diagram for AgoraChatClient:

Instance Methods

(NSString *) - version
 
(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(void) - addMultiDevicesDelegate:delegateQueue:
 
(void) - removeMultiDevicesDelegate:
 
(AgoraChatError *_Nullable) - initializeSDKWithOptions:
 
(AgoraChatError *_Nullable) - changeAppkey:
 
(AgoraChatError *_Nullable) - registerWithUsername:password:
 
(void) - registerWithUsername:password:completion:
 
(void) - fetchTokenWithUsername:password:completion:
 
(AgoraChatError *_Nullable) - loginWithUsername:password:
 
(void) - loginWithUsername:password:completion:
 
(AgoraChatError *_Nullable) - loginWithUsername:token:
 
(void) - loginWithUsername:token:completion:
 
(AgoraChatError *_Nullable) - loginWithUsername:agoraToken:
 
(void) - loginWithUsername:agoraToken:completion:
 
(AgoraChatError *_Nullable) - renewToken:
 
(AgoraChatError *_Nullable) - logout:
 
(void) - logout:completion:
 
(AgoraChatError *_Nullable) - bindPushKitToken:
 
(void) - registerPushKitToken:completion:
 
(AgoraChatError *_Nullable) - unBindPushKitToken
 
(void) - unRegisterPushKitTokenWithCompletion:
 
(AgoraChatError *_Nullable) - bindDeviceToken:
 
(void) - registerForRemoteNotificationsWithDeviceToken:completion:
 
(void) - bindFCMToken:completion:
 
(AgoraChatError *_Nullable) - uploadLogToServer
 
(void) - uploadDebugLogToServerWithCompletion:
 
(NSString *_Nullable) - getLogFilesPath:
 
(void) - getLogFilesPathWithCompletion:
 
(void) - log:
 
(void) - addLogDelegate:delegateQueue:
 
(void) - removeLogDelegate:
 
(NSArray< AgoraChatDeviceConfig * > *_Nullable) - getLoggedInDevicesFromServerWithUsername:password:error:
 
(void) - getLoggedInDevicesFromServerWithUsername:password:completion:
 
(void) - getLoggedInDevicesFromServerWithUserId:token:completion:
 
(AgoraChatError *_Nullable) - kickDeviceWithUsername:password:resource:
 
(void) - kickDeviceWithUsername:password:resource:completion:
 
(void) - kickDeviceWithUserId:token:resource:completion:
 
(void) - kickAllDevicesWithUserId:token:completion:
 
(AgoraChatError *_Nullable) - kickAllDevicesWithUsername:password:
 
(void) - kickAllDevicesWithUsername:password:completion:
 
(AgoraChatDeviceConfig *) - getDeviceConfig:
 
(void) - applicationDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - application:didReceiveRemoteNotification:
 
(void) - serviceCheckWithUsername:password:completion:
 
(id< IAgoraChatTranslateManager > _Nonnull translateManager) - EM_DEPRECATED_IOS
 

Class Methods

(instancetype _Nonnull) + sharedClient
 

Protected Attributes

AgoraChatPushOptions_pushOptions
 

Properties

NSString *_Nonnull version
 
NSString *_Nullable currentUsername
 
AgoraChatOptions *_Nonnull options
 
id< IAgoraChatManager > _Nullable chatManager
 
id< IAgoraChatContactManager > _Nullable contactManager
 
id< IAgoraChatGroupManager > _Nullable groupManager
 
id< IAgoraChatThreadManager > _Nullable threadManager
 
id< IAgoraChatroomManager > _Nullable roomManager
 
id< IAgoraChatPushManager > _Nullable pushManager
 
BOOL isAutoLogin
 
BOOL isLoggedIn
 
BOOL isConnected
 
NSString *_Nullable accessUserToken
 
id< IAgoraChatUserInfoManager > _Nullable userInfoManager
 
id< IAgoraChatPresenceManager > _Nullable presenceManager
 
id< IAgoraChatStatisticsManager > _Nullable statisticsManager
 

Detailed Description

This class is the entry of the Chat SDK, which is responsible for management of modules like login, logout, and connection.

With this class, you can access other modules such as group [AgoraChatClient sharedClient].groupManager.

Method Documentation

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< AgoraChatClientDelegate >_Nonnull)  aDelegate
delegateQueue: (dispatch_queue_t _Nullable)  aQueue 

Adds a delegate.

Parameters
aDelegateThe delegate that you want to add.
aQueue(optional) The queue of calling delegate methods. If you want to run the app on the main thread, set this parameter as nil.

◆ addLogDelegate:delegateQueue:

- (void) addLogDelegate: (id< AgoraChatLogDelegate >_Nonnull)  aDelegate
delegateQueue: (addLog(delegate:queue:))  NS_SWIFT_NAME 

Adds the log callback delegate.

Parameters
aDelegateThe delegate that you want to add.
aQueueThe queue of calling delegate methods.

◆ addMultiDevicesDelegate:delegateQueue:

- (void) addMultiDevicesDelegate: (id< AgoraChatMultiDevicesDelegate >_Nonnull)  aDelegate
delegateQueue: (addMultiDevices(delegate:queue:))  NS_SWIFT_NAME 

Adds the multi-device delegate.

Parameters
aDelegateThe delegate that you want to add.
aQueueThe queue of calling delegate methods.

◆ application:didReceiveRemoteNotification:

- (void) application: (id _Nonnull)  application
didReceiveRemoteNotification: (NSDictionary *_Nullable)  userInfo 

Occurs when the device receives an APNs notification when your app is running in the foreground.

This event is specific to the iOS platform.

Parameters
applicationThe current application instance.
userInfoThe push content.

◆ applicationDidEnterBackground:

- (void) applicationDidEnterBackground: (id _Nonnull)  aApplication

Disconnects from the chat server when the app is switched to the background.

This method is specific to the iOS platform.

Parameters
aApplicationThe current application instance.

◆ applicationWillEnterForeground:

- (void) applicationWillEnterForeground: (id _Nonnull)  aApplication

Reconnects to the server when your app returns to the foreground.

This method is specific to the iOS platform.

Parameters
aApplicationThe current application instance.

◆ bindDeviceToken:

- (AgoraChatError *_Nullable) bindDeviceToken: (NSData *_Nonnull)  aDeviceToken

Binds the device token.

Device token binding is required to enable Apple Push Notification Service.

This is a synchronous method and blocks the current thread.

Parameters
aDeviceTokenThe device token to bind.

@Result If the binding succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ bindFCMToken:completion:

- (void) bindFCMToken: (NSString *_Nonnull)  aFCMToken
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Binds the FCM token, call this API when integrated FCM Notification

This is an asynchronous method.

Parameters
aFCMTokenThe device token generated by FCM SDK.
aCompletionBlockThe completion block, which contains the error message if the method fails.

@Result If the binding succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ bindPushKitToken:

- (AgoraChatError *_Nullable) bindPushKitToken: (NSData *_Nullable)  aPushToken

Uses the PushKit token to bind the user and the device, which is required to enable Apple PushKit Service.

The Apple PushKit service is used to implement VoIP push notifications.

This is a synchronous method and blocks the current thread.

Parameters
aPushTokenThe PushKit token to bind.
Returns
A description of the issue that caused this call to fail.

◆ changeAppkey:

- (AgoraChatError *_Nullable) changeAppkey: (NSString *_Nonnull)  aAppkey

Updates the the App Key, the unique identifier used to access the chat server.

You can only update the App Key when you are logged out.

Parameters
aAppkeyThe new App Key.

@Result A description of the issue that caused this call to fail.

◆ fetchTokenWithUsername:password:completion:

- (void) fetchTokenWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(NSString *_Nullable aToken, AgoraChatError *_Nullable aError))  aCompletionBlock 

Fetches the token from the server.

This is an asynchronous method.

Parameters
aUsernameThe user ID.
aPasswordThe password.
aCompletionBlockThe completion block, which contains the token and the error message if the method fails.

◆ getDeviceConfig:

- (AgoraChatDeviceConfig *) getDeviceConfig: (AgoraChatError **)  pError

Gets information of the current login device.

Returns
Information of the current login device.

◆ getLogFilesPath:

- (NSString *_Nullable) getLogFilesPath: (AgoraChatError **_Nullable)  pError

Compresses the debug logs into a gzip archive (.gz).

You are strongly advised to delete this debug archive once it is no longer used.

This is a synchronous method and blocks the current thread.

Parameters
pErrorA description of the issue that caused this call to fail.
Returns
NSString The full file path of the debug archive.

◆ getLogFilesPathWithCompletion:

- (void) getLogFilesPathWithCompletion: (void(^)(NSString *_Nullable aPath, AgoraChatError *_Nullable aError))  aCompletionBlock

Compresses the debug logs into a gzip archive (.gz).

You are strongly advised to delete this debug archive once it is no longer used.

This is an asynchronous method.

Parameters
aCompletionBlockThe completion block, which contains the token and the error message if the method fails.

◆ getLoggedInDevicesFromServerWithUserId:token:completion:

- (void) getLoggedInDevicesFromServerWithUserId: (NSString *_Nonnull)  aUserID
token: (NSString *_Nonnull)  aToken
completion: (void(^)(NSArray< AgoraChatDeviceConfig * > *_Nullable aList, AgoraChatError *_Nullable aError))  aCompletionBlock 

Gets information of all login devices <AgoraChatDeviceConfig> from the server.

This is an asynchronous method.

Parameters
aUserIDThe user ID.
aTokenThe token.
aCompletionBlockThe completion block, which contains the list and the error message if the method fails.

◆ getLoggedInDevicesFromServerWithUsername:password:completion:

- (void) getLoggedInDevicesFromServerWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(NSArray< AgoraChatDeviceConfig * > *_Nullable aList, AgoraChatError *_Nullable aError))  aCompletionBlock 

Gets information of all login devices from the server.

This is an asynchronous method.

Parameters
aUsernameThe user ID.
aPasswordThe password.
aCompletionBlockThe completion block, which contains the list and the error message if the method fails.

◆ getLoggedInDevicesFromServerWithUsername:password:error:

- (NSArray< AgoraChatDeviceConfig * > *_Nullable) getLoggedInDevicesFromServerWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
error: (AgoraChatError **_Nullable)  pError 

Retrieves all devices a specified user is currently logged in to.

This is a synchronous method and blocks the current thread.

Parameters
aUsernameThe user ID used by the user to log in to the devices.
aPasswordThe password.
pErrorA description of the issue that caused this call to fail.
Returns
The information of the login devices, an array of <AgoraChatDeviceConfig> objects.

◆ initializeSDKWithOptions:

- (AgoraChatError *_Nullable) initializeSDKWithOptions: (AgoraChatOptions *_Nonnull)  aOptions

Initializes the SDK.

Parameters
aOptionsThe SDK options.

@Result A description of the issue that caused this call to fail.

◆ kickAllDevicesWithUserId:token:completion:

- (void) kickAllDevicesWithUserId: (NSString *_Nonnull)  aUserID
token: (NSString *_Nonnull)  aToken
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Kicks a user out of the app on all devices.

This is an asynchronous method.

Parameters
aUserIDThe user ID.
aTokenThe token.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ kickAllDevicesWithUsername:password:

- (AgoraChatError *_Nullable) kickAllDevicesWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword 

Kicks a user out of the app on all devices.

This is a synchronous method and blocks the current thread.

Parameters
aUsernameThe user ID of the user forced to log out of the app on all login devices.
aPasswordThe app login password of the user forced to log out of the app.
Returns
Returns nil on success, and the description of the issue that cause the call to fail.

◆ kickAllDevicesWithUsername:password:completion:

- (void) kickAllDevicesWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Kicks a user out of the app on all devices.

This is an asynchronous method.

Parameters
aUsernameThe user ID of the user to be forced to log out of the app on all login devices.
aPasswordThe app login password of the user to be forced to log out of the app.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ kickDeviceWithUserId:token:resource:completion:

- (void) kickDeviceWithUserId: (NSString *_Nonnull)  aUserID
token: (NSString *_Nonnull)  aToken
resource: (NSString *_Nonnull)  aResource
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Kicks a user out of the app on a specific device.

You can call getLoggedInDevicesFromServerWithUserId to retrieve the list of devices that a user is currently logged in to.

This is an asynchronous method.

Parameters
aUserIDThe user ID of the user to be kicked out of the app.
aTokenThe token.
aResourceThe device to log aUsername out from. Call getLoggedInDevicesFromServerWithUserId to retrieve the list of devices aUsername is currently logged into.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ kickDeviceWithUsername:password:resource:

- (AgoraChatError *_Nullable) kickDeviceWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
resource: (NSString *_Nonnull)  aResource 

Kicks a user out of the app on a specific device.

This is a synchronous method and blocks the current thread.

You can call getLoggedInDevicesFromServerWithUsername to retrieve the list of devices that a user is currently logged in to.

Parameters
aUsernameThe user ID of the user to be kicked out of the app.
aPasswordThe password.
aResourceThe device to log the user out from.
Returns
If the user is successfully kicked out of the app, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ kickDeviceWithUsername:password:resource:completion:

- (void) kickDeviceWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
resource: (NSString *_Nonnull)  aResource
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Kicks a user out of the app on a specific device.

You can call getLoggedInDevicesFromServerWithUsername to retrieve the list of devices that a user is currently logged in to.

This is an asynchronous method.

Parameters
aUsernameThe user ID of the user to be kicked out of the app.
aPasswordThe password.
aResourceThe device to log aUsername out from.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ log:

- (void) log: (NSString *_Nonnull)  aLog

Outputs logs to a log file.

You can call this method after the SDK is initialized.

This is a synchronous method and blocks the current thread.

Parameters
aLogThe log information to output.

◆ loginWithUsername:agoraToken:

- (AgoraChatError *_Nullable) loginWithUsername: (NSString *_Nonnull)  aUsername
agoraToken: (NSString *_Nonnull)  aAgoraToken 

Logs in to the chat server with an Agora Chat user token.

This is a synchronous method and blocks the current thread. This method supports automatic login.

Parameters
aUsernameThe user ID.
aAgoraTokenThe Agora Chat user token.
Returns
If the login succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ loginWithUsername:agoraToken:completion:

- (void) loginWithUsername: (NSString *_Nonnull)  aUsername
agoraToken: (NSString *_Nonnull)  aAgoraToken
completion: (void(^)(NSString *_Nonnull aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 

Logs in to the chat server with Agora Chat user token.

This is an asynchronous method. It supports automatic login.

Parameters
aUsernameThe user ID.
aAgoraTokenThe Agora Chat user token.
aCompletionBlockThe callback of completion block, which contains the description of the cause to the issue if the method fails.

◆ loginWithUsername:password:

- (AgoraChatError *_Nullable) loginWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword 

Logs in to the chat server with a password.

This is a synchronous method and blocks the current thread.

It is recommended that you log in to the chat service with a token.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aPasswordThe password. The maximum length is 64 characters. Ensure that you set this parameter.
Returns
If the login succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ loginWithUsername:password:completion:

- (void) loginWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(NSString *_Nonnull aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 

Logs in to the chat server with a password.

This is an asynchronous method.

It is recommended that you log in to the chat service with a token.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aPasswordThe password. The maximum length is 64 characters. Ensure that you set this parameter.
aCompletionBlockThe completion block, which contains the username and the error message if the method fails.

◆ loginWithUsername:token:

- (AgoraChatError *_Nullable) loginWithUsername: (NSString *_Nonnull)  aUsername
token: (NSString *_Nonnull)  aToken 

Logs in to the chat server with a token.

This method does not support automatic login.

This is a synchronous method and blocks the current thread.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aTokenThe token for login to the chat server.
Returns
If the login succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ loginWithUsername:token:completion:

- (void) loginWithUsername: (NSString *_Nonnull)  aUsername
token: (NSString *_Nonnull)  aToken
completion: (void(^)(NSString *_Nonnull aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 

Logs in to the chat server with a token.

This is an asynchronous method. This method supports automatic login.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aTokenThe token for login to the chat server.
aCompletionBlockThe completion block, which contains the user ID and the error message if the method fails.

◆ logout:

- (AgoraChatError *_Nullable) logout: (BOOL)  aIsUnbindDeviceToken

Logs out of the chat server.

This is a synchronous method and blocks the current thread.

Parameters
aIsUnbindDeviceTokenWhether to unbind the user ID from the device.
  • Yes:Yes. Once the user ID is unbound from the device, the user device stops receiving push notifications from the Apple Push Notifications service. If the unbinding fails, the SDK returns an error that includes the reason for the failure.
  • NO:No.
Returns
A description of the issue that caused this call to fail.

◆ logout:completion:

- (void) logout: (BOOL)  aIsUnbindDeviceToken
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Logs out of the chat server.

This is an asynchronous method.

Parameters
aIsUnbindDeviceTokenWhether to unbind the user ID from the device.
  • Yes:Yes. Once the user ID is unbound from the device, the user device stops receiving push notifications from the Apple Push Notifications service. If the unbinding fails, the SDK returns an error that includes the reason for the failure.
  • NO:No.
aCompletionBlockThe completion block, which contains the token and the error message if the method fails.

◆ registerForRemoteNotificationsWithDeviceToken:completion:

- (void) registerForRemoteNotificationsWithDeviceToken: (NSData *_Nonnull)  aDeviceToken
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Registers the device token.

Device token binding is required to enable Apple push notification service.

This is an asynchronous method.

Parameters
aDeviceTokenThe device token to bind.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ registerPushKitToken:completion:

- (void) registerPushKitToken: (NSData *_Nullable)  aPushToken
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 

Registers a PushKit token.

The Apple PushKit service is used to implement VoIP push notifications.

This is an asynchronous method.

Parameters
aPushTokenThe PushKit token to register.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ registerWithUsername:password:

- (AgoraChatError *_Nullable) registerWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword 

Registers a new user.

This method is not recommended and you are advised to call the RESTful API to register a new user.

After you call initializeSDKWithOptions and register your app in the console, the app has access to all the features registered inside your chat network. You add and remove users inside your chat network; depending on how you implement your app, you control the people each user can see inside your network.

This is a synchronous method and blocks the current thread. To ensure the registration reliability, we recommend using the RESTful API to register new chat users.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aPasswordThe password. The maximum length is 64 characters. Ensure that you set this parameter.
Returns
A description of the issue that caused this call to fail.

◆ registerWithUsername:password:completion:

- (void) registerWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(NSString *_Nonnull aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 

Registers a new user.

This is an asynchronous method. This method is not recommended and you are advised to call the RESTful API to register a user.

To ensure registration reliability, we recommend using the RESTful API to register new chat users.

Parameters
aUsernameThe user ID. The maximum length is 64 characters. Ensure that you set this parameter. Supported characters include the 26 English letters (a-z), the ten numbers (0-9), the underscore (_), the hyphen (-), and the English period (.). This parameter is case insensitive, and upper-case letters are automatically changed to low-case ones. If you want to set this parameter as a regular expression, set it as ^[a-zA-Z0-9_-]+$.
aPasswordThe password. The maximum length is 64 characters. Ensure that you set this parameter.
aCompletionBlockThe completion block, which contains the username and the error message if the method fails.

◆ removeDelegate:

- (void) removeDelegate: (id _Nonnull)  aDelegate

Removes a delegate.

Parameters
aDelegateThe delegate that you want to remove.

◆ removeLogDelegate:

- (void) removeLogDelegate: (removeLog(delegate:))  NS_SWIFT_NAME

Removes the log callback delegate.

Parameters
aDelegateThe log callback delegate that you want to delete.

◆ removeMultiDevicesDelegate:

- (void) removeMultiDevicesDelegate: (id< AgoraChatMultiDevicesDelegate >_Nonnull)  aDelegate

Removes the multi-device delegate.

Parameters
aDelegateThe multi-device delegate that you want to delete.

◆ renewToken:

- (AgoraChatError *_Nullable) renewToken: (NSString *_Nonnull)  newAgoraToken

Renews the user token when the current token expires.

If you are logged in with an Agora Chat user token and you are notified via the ClientDelegate callback that the token is about to expire, you can call this method to renew the token to prevent unknown issues caused by an invalid token.

This is a synchronous method and blocks the current thread.

Parameters
newAgoraTokenThe new Agora Chat token。
Returns
The result which contains the description of the cause to the failure if call fails.

◆ serviceCheckWithUsername:password:completion:

- (void) serviceCheckWithUsername: (NSString *_Nonnull)  aUsername
password: (NSString *_Nonnull)  aPassword
completion: (void(^)(AgoraChatServerCheckType aType, AgoraChatError *_Nullable aError))  aCompletionBlock 

Runs the server diagnostic test for a specific user.

These tests are run in the order defined by AgoraChatServerCheckType.

If the user is logged in, the login account is used by default.

This is an asynchronous method.

Parameters
aUsernameThe user ID.
aPasswordThe password.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ sharedClient

+ (instancetype _Nonnull) sharedClient

Creates a Client instance. The Client class is the entry to the Chat SDK. You need to call this method to create a Client instance before calling any other methods.

◆ unBindPushKitToken

- (AgoraChatError *_Nullable) unBindPushKitToken

Unbinds the Apple PushKit token from the device.

This method plays the same role as the unRegisterPushKitTokenWithCompletion method.

The Apple PushKit service is used to implement VoIP push notifications.

This is a synchronous method and blocks the current thread.

Returns
A description of the issue that caused this call to fail.

◆ unRegisterPushKitTokenWithCompletion:

- (void) unRegisterPushKitTokenWithCompletion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock

Unregisters the Apple PushKit token.

This method plays the same role as the unBindPushKitToken method.

This is an asynchronous method.

The Apple PushKit service is used to implement VoIP push notifications.

Parameters
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ uploadDebugLogToServerWithCompletion:

- (void) uploadDebugLogToServerWithCompletion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock

Uploads the debug log to the chat server.

Parameters
aCompletionBlockThe completion block, which contains the token and the error message if the method fails.

◆ uploadLogToServer

- (AgoraChatError *_Nullable) uploadLogToServer

Uploads the log to the chat server.

The information in the debug log is used by our engineers to fix errors and improve system performance.

This is a synchronous method and blocks the current thread.

Returns
If the upload succeeds, the SDK returns nil; otherwise, the SDK returns the description of the issue that causes the call to fail.

◆ version

- (NSString *) version

The SDK version number.

Property Documentation

◆ accessUserToken

- (NSString* _Nullable) accessUserToken
readnonatomicassign

The token used by the current user to access the chat server.

The user needs to use the user ID and password for the first login. If the login succeeds, a token is returned and the user can use it for subsequent logins.

◆ chatManager

- (id<IAgoraChatManager> _Nullable) chatManager
readnonatomicstrong

The chat manager module.

◆ contactManager

- (id<IAgoraChatContactManager> _Nullable) contactManager
readnonatomicstrong

The contact manager module.

◆ currentUsername

- (NSString* _Nullable) currentUsername
readnonatomicstrong

The ID of the user currently logged in to your chat app.

◆ groupManager

- (id<IAgoraChatGroupManager> _Nullable) groupManager
readnonatomicstrong

The group manager module.

◆ isAutoLogin

- (BOOL) isAutoLogin
readnonatomicassign

Whether to allow a user to automatically log in to the chat server with the user ID used last time.

  • YES:Yes.
  • NO:No.

    If the login fails, for example, because of an incorrect password or a deactivated user account, this parameter will be reset to NO. In this case, you need to set it back to YES to allow automatic login.

◆ isConnected

- (BOOL) isConnected
readnonatomicassign

Whether the SDK is connected to the chat server.

  • YES:Yes.
  • NO:No.

◆ isLoggedIn

- (BOOL) isLoggedIn
readnonatomicassign

Whether the current user is already logged in to the chat server.

  • YES:The current user is already logged in.
  • NO:The current user is not logged in.

◆ options

- (AgoraChatOptions* _Nonnull) options
readnonatomicstrong

The SDK setting options. For example, whether to use HTTPs by default.

◆ presenceManager

- (id<IAgoraChatPresenceManager> _Nullable) presenceManager
readnonatomicstrong

The presence manager module.

◆ pushManager

- (id<IAgoraChatPushManager> _Nullable) pushManager
readnonatomicstrong

The push manager module.

◆ roomManager

- (id<IAgoraChatroomManager> _Nullable) roomManager
readnonatomicstrong

The chat room manager module.

◆ statisticsManager

- (id<IAgoraChatStatisticsManager> _Nullable) statisticsManager
readnonatomicstrong

The message statistics manager module.

◆ threadManager

- (id<IAgoraChatThreadManager> _Nullable) threadManager
readnonatomicstrong

The thread manager module.

◆ userInfoManager

- (id<IAgoraChatUserInfoManager> _Nullable) userInfoManager
readnonatomicstrong

The user attribute manager module.

◆ version

- (NSString* _Nonnull) version
readnonatomicstrong

The SDK version number.


The documentation for this class was generated from the following file: