ChatClient class Null safety
The ChatClient class, which is the entry point of the Chat SDK. With this class, you can log in, log out, and access other functionalities such as group and chatroom.
Properties
- chatManager → ChatManager
-
Gets the
ChatManagerclass. Make sure to call it after ChatClient has been initialized.read-only - chatRoomManager → ChatRoomManager
-
Gets the
ChatRoomManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - chatThreadManager → ChatThreadManager
-
Gets the
ChatThreadManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - contactManager → ChatContactManager
-
Gets the
ChatContactManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - currentUsername → String?
-
Gets the current logged-in username.
read-only
- groupManager → ChatGroupManager
-
Gets the
ChatGroupManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - hashCode → int
-
The hash code for this object.
read-only, inherited
- options → ChatOptions?
-
Gets the configurations.
read-only
- presenceManager → ChatPresenceManager
-
Gets the
ChatPresenceManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - pushManager → ChatPushManager
-
Gets the
ChatPushManagerclass. Make sure to call it after the ChatClient has been initialized.read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- userInfoManager → ChatUserInfoManager
-
Gets the
ChatUserInfoManagerclass. Make sure to call it after the ChatClient has been initialized.read-only
Methods
-
addConnectionListener(
ChatConnectionListener listener) → void - Adds the connection listener of chat server.
-
addCustomListener(
ChatCustomListener listener) → void - Adds a custom listener to receive data from iOS or Android devices.
-
addMultiDeviceListener(
ChatMultiDeviceListener listener) → void - Adds the multi-device listener.
-
changeAppKey(
{required String newAppKey}) → Future< bool> - Updates the App Key, which is the unique identifier to access Agora Chat.
-
clearAllConnectionListeners(
) → void - Removes all chat server connection listeners.
-
clearAllCustomListeners(
) → void - Removes all custom listeners.
-
clearAllMultiDeviceListeners(
) → void - Removes all multi-device listener.
-
compressLogs(
) → Future< String> - Compresses the debug log into a gzip archive.
-
createAccount(
String username, String password) → Future< void> - Register a new user.
-
getAccessToken(
) → Future< String> - Gets the token of the current logged-in user.
-
getCurrentUsername(
) → Future< String?> - Gets the current login user ID.
-
getLoggedInDevicesFromServer(
{required String username, required String password}) → Future< List< ChatDeviceInfo> > - Gets all the information about the logged in devices under the specified account.
-
init(
ChatOptions options) → Future< void> - Initializes the SDK.
-
isConnected(
) → Future< bool> - Checks whether the SDK is connected to the chat server.
-
isLoginBefore(
) → Future< bool> - Checks whether the user has logged in before and did not log out.
-
kickAllDevices(
{required String username, required String password}) → Future< void> - Kicks out all the devices logged in under the specified account.
-
kickDevice(
{required String username, required String password, required String resource}) → Future< bool> - Forces the specified account to log out from the specified device.
-
login(
String username, String pwdOrToken, [bool isPassword = true]) → Future< void> - An app user logs in to the chat server with a password or token.
-
loginWithAgoraToken(
String username, String agoraToken) → Future< void> - An app user logs in to the chat server by username and Agora token. This method supports automatic login.
-
logout(
[bool unbindDeviceToken = true]) → Future< void> - An app user logs out.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
removeConnectionListener(
ChatConnectionListener listener) → void - Removes the chat server connection listener.
-
removeCustomListener(
ChatCustomListener listener) → void - Removes the custom listener.
-
removeMultiDeviceListener(
ChatMultiDeviceListener listener) → void - Removes the multi-device listener.
-
renewAgoraToken(
String agoraToken) → Future< void> - Renews the Agora token.
-
startCallback(
) → Future< void> - Start contact and group, chatroom callback.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- getInstance → ChatClient
-
read-only