Protected
Optional
_eventStatic
eventProtected
Static
TAGGets the chat manager class.
This method can be called only after the chat client is initialized.
The chat manager class.
Gets the contact manager class.
This method can be called only after the chat client is initialized.
The contact manager class.
Gets the current logged-in user ID.
Note
The user ID for successful login is valid.
The user ID is obtained from the memory and updated in the case of login, logout, and reconnection upon disconnection. You can call getCurrentUsername to get the latest data from the server.
The current logged-in user ID.
Gets the chat group manager class.
This method can be called only after the chat client is initialized.
The chat group manager class.
Gets the SDK configurations.
Ensure that you set the SDK options during initialization. See ChatOptions.
The SDK configurations.
Gets the presence manager class.
This method can be called only after the chat client is initialized.
The presence manager class.
Gets the push manager class.
This method can be called only after the chat client is initialized.
The push manager class.
Gets the chat room manager class.
This method can be called only after the chat client is initialized.
The chat room manager class.
Gets the user information manager class.
This method can be called only after the chat client is initialized.
The user information manager class.
Adds the connection status listener.
The connection status listener to add.
Adds a custom listener to receive data that the iOS or Android devices send to the React Native layer.
The custom listener to add.
Add error listener.
Monitor SDK internal errors.
Adds the multi-device listener.
The multi-device listener to add.
Updates the App Key, which is the unique identifier used to access the chat service.
Note
As this key controls access to the chat service for your app, you can only update the key when the current user is logged out.
Updating the App Key means to switch to a new App Key.
You can retrieve the new App Key from the Console.
You can also set an App Key by using the ChatOptions.appKey method when logged out.
The new App Key. Ensure that you set this parameter.
A description of the exception. See ChatError.
Compresses the debug log file into a gzip archive.
We strongly recommend that you delete this debug archive once it is no longer used.
The path of the compressed gzip file.
A description of the exception. See ChatError.
Creates a new user (open registration).
Note
There are two registration modes:
Open registration: This mode is for testing use, but not recommended in a formal environment; If a call failure occurs, you can contact our business manager.
Authorized registration: You can create a new user through a REST API, and then save it to your server or return it to the client.
The user ID. Ensure that you set this parameter. The user ID can be a maximum of 64 characters of the following types: - 26 English letters (a-z) - 10 numbers (0-9), - "", "-", "." The user ID is case-insensitive, so Aa and aa are the same user ID. The email address or the UUID of the user cannot be used as the user ID. You can also set this parameter with the regular expression ^[a-zA-Z0-9-]+$.
The password. Ensure that you set this parameter. The password can contain a maximum of 64 characters.
A description of the exception. See ChatError.
Gets the token for login.
The token for login.
A description of the exception. See ChatError.
Gets the current logged-in user ID from the server.
Note
To get the current logged-in user ID from the memory, see currentUserName.
The logged-in user ID.
A description of the exception. See ChatError.
Gets the list of online devices to which you have logged in with a specified account.
The user ID.
The password or token.
Optional
isPassword: booleanIf true, use password, otherwise use token. Default is true. See pwdOrToken
The list of the online logged-in devices.
A description of the exception. See ChatError.
Initializes the SDK.
Note
The options for SDK initialization. Ensure that you set the options. See ChatOptions.
A description of the exception. See ChatError.
Checks whether the SDK is connected to the chat server.
Whether the SDK is connected to the chat server.
- true
: Yes.
- false
: No.
A description of the exception. See ChatError.
Checks whether the current user is logged in to the app.
Note
This method needs to be called after initialization and before login.
Whether the user is logged in to the app:
- true
: The user is logged in to the app. In automatic login mode, the SDK returns true
before successful login and false
otherwise.
- false
: The user is not logged in to the app. In non-automatic login mode, the SDK returns false
.
A description of the exception. See ChatError.
Logs out from a specified account on all devices.
The user ID.
The password or token.
Optional
isPassword: booleanWhether the password or user token is used. See pwdOrToken.
true
:The password is used.false
: The user token is used.A description of the exception. See ChatError.
Logs out from a specified account on a device.
For how to get the device ID, see ChatDeviceInfo.resource.
The user ID.
The password or token.
The device ID. See ChatDeviceInfo.resource.
Optional
isPassword: booleanWhether the password or user token is used. See pwdOrToken.
true
:The password is used.false
: The user token is used.A description of the exception. See ChatError.
Logs in to the chat server with a password or an Easemob token. An exception message is thrown if the login fails.
Note
If you use an Easemob token to log in to the server, you can get the token in either of the following ways:
The token expiration reminder is returned by the two callback methods: ChatConnectEventListener.onTokenWillExpire and ChatConnectEventListener.onTokenDidExpire.
The user ID. See createAccount.
The password or token. See createAccount or getAccessToken
Whether to log in with a password or a token.
- true
: A password is used.
- (Default) false
: A token is used.
A description of the exception. See ChatError.
Please use with loginWithToken instead.
The user ID. See createAccount.
The Agora token.
2023-11-17 Use login instead.
Logs in to the chat server with the user ID and an Agora token. An exception message is thrown if the login fails.
Note
The Agora token is different from token login.token provided by Easemob.
This method supports automatic login.
A description of the exception. See ChatError.
Logs in to the chat server with a token. An exception message is thrown if the login fails.
Note
If you use a token to log in to the server, you can get the token in either of the following ways:
The token expiration reminder is returned by the two callback methods: ChatConnectEventListener.onTokenWillExpire and ChatConnectEventListener.onTokenDidExpire.
The user ID.
The token.
A description of the exception. See ChatError.
Logs out of the chat app. An exception message is thrown if the logout fails.
Whether to unbind the token upon logout. This parameter is available only to mobile platforms.
true
: Yes.false
: No.A description of the exception. See ChatError.
Removes the connection status listener.
The connection status listener to remove.
Removes a custom listener to stop receiving data that the iOS or Android devices send to the React Native layer.
The custom listener to remove.
Remove error listener.
Removes the specified multi-device listener.
The multi-device listener to remove.
Renews the Agora token.
Note
If you log in with an Agora token and are notified by the callback method ChatConnectEventListener that the token is to expire, you can call this method to update the token to avoid unknown issues caused by an invalid token.
The new Agora token.
A description of the exception. See ChatError.
Update push configurations.
Note For the iOS platform, you need to pass the device ID during initialization. Otherwise, the push function cannot be used properly. See ChatClient.init
The push config, See ChatPushConfig
A description of the exception. See ChatError.
Protected
Static
_callProtected
Static
checkStatic
getProtected
Static
handleOptional
callback: ChatGroupFileStatusCallbackProtected
Static
handleOptional
callback: ChatMessageStatusCallback
The chat client class, which is the entry of the chat SDK. It defines how to log in to and log out of the chat app and how to manage the connection between the SDK and the chat server.