agora_chat_SDK
3.8.2
|
#import <AgoraChatClient.h>
Class Methods | |
(instancetype) | + sharedClient |
Protected Attributes | |
AgoraPushOptions * | _pushOptions |
Properties | |
NSString * | version |
NSString * | currentUsername |
AgoraOptions * | options |
id< IAgoraChatManager > | chatManager |
id< IAgoraContactManager > | contactManager |
id< IAgoraGroupManager > | groupManager |
id< IAgoraChatroomManager > | roomManager |
id< IAgoraPushManager > | pushManager |
BOOL | isAutoLogin |
BOOL | isLoggedIn |
BOOL | isConnected |
NSString * | accessUserToken |
id< IAgoraUserInfoManager > | userInfoManager |
IM SDK Client, entrance of SDK, used to login, logout, and get access IM modules, such as [AgoraChatClient sharedClient].groupManager;
- (void) addDelegate: | (3_1_0) | ||
(3_2_2) | |||
("Use - instead") | EM_DEPRECATED_IOS[IEMCallManager addDelegate:delegateQueue:] | ||
Add delegate
aDelegate | Delegate |
- (void) addDelegate: | (id< AgoraChatClientDelegate >) | aDelegate | |
delegateQueue: | (dispatch_queue_t) | aQueue | |
Add delegate
aDelegate | Delegate |
aQueue | (optional) The queue of calling delegate methods. Pass in nil to run on main thread. |
- (void) addMultiDevicesDelegate: | (id< AgoraMultiDevicesDelegate >) | aDelegate | |
delegateQueue: | (dispatch_queue_t) | aQueue | |
Add multi-device delegate
aDelegate | Delegate |
aQueue | The queue of calling delegate methods |
- (void) application: | (id) | application | |
didReceiveRemoteNotification: | (NSDictionary *) | userInfo | |
Invoked when receiving APNS in foreground
application | UIApplication |
userInfo | Push content |
- (void) applicationDidEnterBackground: | (id) | aApplication |
Disconnect from server when app enters background
aApplication | UIApplication |
- (void) applicationWillEnterForeground: | (id) | aApplication |
Reconnect to server when app enters foreground
aApplication | UIApplication |
- (void) asyncBindDeviceToken: | (NSData *) | aDeviceToken | |
success: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -registerForRemoteNotificationsWithDeviceToken:completion: instead") | EM_DEPRECATED_IOS | ||
Bind device token
aDeviceToken | Device token to bind |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncGetPushOptionsFromServer: | (void(^)(AgoraPushOptions *aOptions)) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -getPushOptionsFromServerWithCompletion: instead") | EM_DEPRECATED_IOS | ||
Get apns options from the server
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncLoginWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
success: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -loginWithUsername:password:completion: instead") | EM_DEPRECATED_IOS | ||
Login
aUsername | Username |
aPassword | Password |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncLogout: | (BOOL) | aIsUnbindDeviceToken | |
success: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -logout:completion: instead") | EM_DEPRECATED_IOS | ||
Logout
aIsUnbindDeviceToken | Unbind device token to disable the Apple Push Notification Service |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncRegisterWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
success: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -registerWithUsername:password:completion: instead") | EM_DEPRECATED_IOS | ||
Register a new user
To enhance the reliability, registering new IM user through REST API from backend is highly recommended
aUsername | Username |
aPassword | Password |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncSetApnsNickname: | (NSString *) | aNickname | |
success: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -updatePushNotifiationDisplayName:copletion: instead") | EM_DEPRECATED_IOS | ||
Set display name for push notification
aNickname | Push Notification display name |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncUpdatePushOptionsToServer: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -updatePushNotificationOptionsToServerWithCompletion: instead") | EM_DEPRECATED_IOS | ||
Update APNS options to the server
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncUploadLogToServer: | (void(^)()) | aSuccessBlock | |
failure: | (3_1_0) | ||
(3_2_2) | |||
("Use -uploadDebugLogToServerWithCompletion: instead") | EM_DEPRECATED_IOS | ||
Upload log to server
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (AgoraError *) bindDeviceToken: | (NSData *) | aDeviceToken |
Device token binding is required to enable Apple Push Notification Service
Synchronization method will block the current thread
aDeviceToken | Device token to bind |
- (AgoraError *) bindPushKitToken: | (NSData *) | aPushToken |
Pushkit token binding is required to enable Apple PushKit Service
Synchronization method will block the current thread
aPushToken | pushkit token to bind |
- (AgoraError *) changeAppkey: | (NSString *) | aAppkey |
Change appkey. Can only change appkey when the user is logged out
aAppkey | appkey |
- (3_1_0, 3_2_2, "Use -migrateDatabaseToLatestSDK instead") EM_DEPRECATED_IOS |
iOS-specific, data migration to SDK3.0
Synchronization method will block the current thread
It's needed to call this method when update to SDK3.0, developers need to wait this method complete before DB related operations
- (AgoraPushOptions* pushOptions) EM_DEPRECATED_IOS | (3_1_0) | ||
(3_7_2) | |||
("Use - instead") | [IAgoraPushManager.pushOptions] | ||
Apple Push Notification Service setting
- (3_1_0, 3_7_2, "") EM_DEPRECATED_IOS |
Update Apple Push Notification Service options to the server
Synchronization method will block the current thread
- (void) fetchTokenWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(NSString *aToken, AgoraError *aError)) | aCompletionBlock | |
Get the token from the server
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback of completion block |
- (NSString *) getLogFilesPath: | (AgoraError **) | pError |
Compress the log file into a .gz file and return the gz file path. Recommend delete the gz file if file is no longer used
Synchronization method will block the current thread
pError | Error |
- (void) getLogFilesPathWithCompletion: | (void(^)(NSString *aPath, AgoraError *aError)) | aCompletionBlock |
Compress the log file into a .gz file and return the gz file path. Recommend delete the gz file if file is no longer used
aCompletionBlock | The callback of completion block |
- (void) getLoggedInDevicesFromServerWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(NSArray *aList, AgoraError *aError)) | aCompletionBlock | |
Get all the device information <AgoraDeviceConfig> that logged in to the server
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback block of completion |
- (NSArray *) getLoggedInDevicesFromServerWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
error: | (AgoraError **) | pError | |
Get all the device information <AgoraDeviceConfig> that logged in to the server
Synchronization method will block the current thread
aUsername | Username |
aPassword | Password |
pError | Error |
- (void) getPushNotificationOptionsFromServerWithCompletion: | (3_1_0) | ||
(3_7_2) | |||
("Use - instead") | EM_DEPRECATED_IOS[IAgoraPushManager:getPushNotificationOptionsFromServerWithCompletion:] | ||
Get Apple Push Notification Service options from the server
aCompletionBlock | The callback of completion block |
- (AgoraPushOptions *) getPushOptionsFromServerWithError: | (3_1_0) | ||
(3_7_2) | |||
("Use - instead") | EM_DEPRECATED_IOS[IAgoraPushManager:getPushOptionsFromServerWithError:] | ||
Get Apple Push Notification Service options from the server
Synchronization method will block the current thread
pError | Error |
- (AgoraError *) initializeSDKWithOptions: | (AgoraOptions *) | aOptions |
- (AgoraError *) kickAllDevicesWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
Force logout all logged in device for the specified user
Synchronization method will block the current thread
aUsername | Username |
aPassword | Password |
- (void) kickAllDevicesWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(AgoraError *aError)) | aCompletionBlock | |
Force all logged in device to logout.
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback block of completion |
- (AgoraError *) kickDevice: | (AgoraDeviceConfig *) | aDevice | |
username: | (NSString *) | aUsername | |
password: | (3_1_0) | ||
(3_2_2) | |||
("Use - kickDeviceWithUsername:password:resource: instead") | EM_DEPRECATED_IOS | ||
Force logout the specified device
device information can be obtained from getLoggedInDevicesFromServerWithUsername:password:error:
Synchronization method will block the current thread
aDevice | device information <AgoraDeviceConfig> |
aUsername | Username |
aPassword | Password |
- (void) kickDevice: | (AgoraDeviceConfig *) | aDevice | |
username: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (3_1_0) | ||
(3_2_2) | |||
("Use - kickDeviceWithUsername:password:resource:completion: instead") | EM_DEPRECATED_IOS | ||
Force logout the specified device
device information can be obtained from getLoggedInDevicesFromServerWithUsername:password:error:
aDevice | device information <AgoraDeviceConfig> |
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback block of completion |
- (AgoraError *) kickDeviceWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
resource: | (NSString *) | aResource | |
Force logout the specified device
device information can be obtained from getLoggedInDevicesFromServerWithUsername:password:error:
Synchronization method will block the current thread
aUsername | Username |
aPassword | Password |
aResource | device resource |
- (void) kickDeviceWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
resource: | (NSString *) | aResource | |
completion: | (void(^)(AgoraError *aError)) | aCompletionBlock | |
Force logout the specified device
device information can be obtained from getLoggedInDevicesFromServerWithUsername:password:error:
aUsername | Username |
aPassword | Password |
aResource | device resource |
aCompletionBlock | The callback block of completion |
- (void) log: | (NSString *) | aLog |
Output log info to log file.You can call this method after the SDK has been initialized.
aLog | The log info |
- (AgoraError *) loginWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
Login with password
Synchronization method will block the current thread
aUsername | Username It cannot be empty, it can be letters/numbers/underscores/horizontals/periods. The regular expression is "^[a-zA-Z0-9_-]+$". Nothing else is allowed. If it is an uppercase letter, it will be automatically converted to lowercase. The length cannot exceed 64 characters in length |
aPassword | Password Cannot be empty, and the length cannot exceed 64 characters in length |
- (void) loginWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(NSString *aUsername, AgoraError *aError)) | aCompletionBlock | |
Login with password
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback of completion block |
- (AgoraError *) loginWithUsername: | (NSString *) | aUsername | |
token: | (NSString *) | aToken | |
Login with token. Does not support automatic login
Synchronization method will block the current thread
aUsername | Username |
aToken | Token |
- (void) loginWithUsername: | (NSString *) | aUsername | |
token: | (NSString *) | aToken | |
completion: | (void(^)(NSString *aUsername, AgoraError *aError)) | aCompletionBlock | |
Login with token. Does not support automatic login
aUsername | Username |
aToken | Token |
aCompletionBlock | The callback of completion block |
- (AgoraError *) logout: | (BOOL) | aIsUnbindDeviceToken |
Logout
Synchronization method will block the current thread
aIsUnbindDeviceToken | Unbind device token to disable Apple Push Notification Service |
- (void) logout: | (BOOL) | aIsUnbindDeviceToken | |
completion: | (void(^)(AgoraError *aError)) | aCompletionBlock | |
Logout
aIsUnbindDeviceToken | Whether to unbind the device token, the device will no longer receive push notifications after unbinding, If YES is passed in, unbinding fails and error will be returned |
aCompletionBlock | The callback of completion block |
- (BOOL) migrateDatabaseToLatestSDK |
Migrate the IM database to the latest SDK version
Synchronization method will block the current thread
- (void) registerForRemoteNotificationsWithDeviceToken: | (NSData *) | aDeviceToken | |
completion: | (void(^)(AgoraError *aError)) | aCompletionBlock | |
Device token binding is required to enable Apple push notification service
aDeviceToken | Device token to bind |
aCompletionBlock | The callback block of completion |
- (void) registerPushKitToken: | (NSData *) | aPushToken | |
completion: | (void(^)(AgoraError *aError)) | aCompletionBlock | |
Pushkit token binding is required to enable Apple PushKit Service
aPushToken | pushkit token to bind |
aCompletionBlock | The callback block of completion |
- (AgoraError *) registerWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
Register a new IM user
To ensure good reliability, registering new IM user via REST API from developer backend is highly recommended
aUsername | Username |
aPassword | Password |
- (void) registerWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(NSString *aUsername, AgoraError *aError)) | aCompletionBlock | |
Register a new IM user
To ensure good reliability, registering new IM user via REST API from developer backend is highly recommended
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback of completion block |
- (void) removeDelegate: | (id) | aDelegate |
Remove delegate
aDelegate | Delegate |
- (void) removeMultiDevicesDelegate: | (id< AgoraMultiDevicesDelegate >) | aDelegate |
Remove multi devices delegate
aDelegate | Delegate |
- (void) serviceCheckWithUsername: | (NSString *) | aUsername | |
password: | (NSString *) | aPassword | |
completion: | (void(^)(AgoraServerCheckType aType, AgoraError *aError)) | aCompletionBlock | |
Make a diagnose for service, Diagnosis of current services according to the order of AgoraServerCheckType enumeration, and callback for the developer If you have logged in, use the default login account
aUsername | username |
aPassword | password |
aCompletionBlock | The callback block of completion |
- (AgoraError *) setApnsNickname: | (3_1_0) | ||
(3_7_2) | |||
("Use - instead") | EM_DEPRECATED_IOS[IAgoraPushManager:setApnsNickname:] | ||
Set display name for Apple Push Notification message
Synchronization method will block the current thread
aNickname | Display name |
+ (instancetype) sharedClient |
Get SDK singleton instance
- (AgoraError *) unBindPushKitToken |
Disable Apple PushKit Service
Synchronization method will block the current thread
- (void) unRegisterPushKitTokenWithCompletion: | (void(^)(AgoraError *aError)) | aCompletionBlock |
Disable Apple PushKit Service
aCompletionBlock | The callback block of completion |
- (void) updatePushNotifiationDisplayName: | (NSString *) | aDisplayName | |
completion: | (3_1_0) | ||
(3_7_2) | |||
("Use - instead") | EM_DEPRECATED_IOS[IAgoraPushManager:updatePushNotifiationDisplayName:completion:] | ||
Set display name for the push notification
aDisplayName | Display name of push |
aCompletionBlock | The callback block of completion |
- (void) updatePushNotificationOptionsToServerWithCompletion: | (3_1_0) | ||
(3_7_2) | |||
("") | EM_DEPRECATED_IOS | ||
Update Apple Push Notification Service options to the server
aCompletionBlock | The callback block of completion |
- (void) uploadDebugLogToServerWithCompletion: | (void(^)(AgoraError *aError)) | aCompletionBlock |
Upload debugging log to server
aCompletionBlock | The callback of completion block |
- (AgoraError *) uploadLogToServer |
Upload debugging log to server
Synchronization method will block the current thread
|
readnonatomicassign |
Current user hyphenate token
|
readnonatomicstrong |
Chat Management
|
readnonatomicstrong |
Contact Management
|
readnonatomicstrong |
Current logged in user's username
|
readnonatomicstrong |
Group Management
|
readnonatomicassign |
If SDK will automatically log into with previously logged in session. If the current login failed, then isAutoLogin attribute will be reset to NO, you need to set it back to YES in order to allow automatic login
|
readnonatomicassign |
Whether connection to Hyphenate IM server
|
readnonatomicassign |
If a user logged in
|
readnonatomicstrong |
SDK setting options
|
readnonatomicstrong |
push Management
|
readnonatomicstrong |
Chat Room Management
|
readnonatomicstrong |
User attribute related
|
readnonatomicstrong |
SDK version