ChatClient class
~english 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. ~end
~chinese 该类是 Chat SDK 的入口,负责登录、退出及连接管理等,由此可以获得其他模块的入口。 ~end
Properties
- chatManager → ChatManager
-
no setter
- chatRoomManager → ChatRoomManager
-
no setter
- chatThreadManager → ChatThreadManager
-
no setter
- contactManager → ChatContactManager
-
no setter
- currentUserId → String?
-
no setter
- customEventHandler ↔ void Function(Map map)?
-
getter/setter pair
- groupManager → ChatGroupManager
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- options → ChatOptions?
-
no setter
- presenceManager → ChatPresenceManager
-
no setter
- pushManager → ChatPushManager
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userInfoManager → ChatUserInfoManager
-
no setter
Methods
-
addConnectionEventHandler(
String identifier, ConnectionEventHandler handler) → void - ~english Adds the connection event handler. After calling this method, you can handle new connection events when they arrive.
-
addMultiDeviceEventHandler(
String identifier, ChatMultiDeviceEventHandler handler) → void - ~english Adds the multi-device event handler. After calling this method, you can handle for new multi-device events when they arrive.
-
changeAppId(
{required String newAppId}) → Future< bool> - ~english Updates the App Id, which is the unique identifier to access Agora Chat.
-
changeAppKey(
{required String newAppKey}) → Future< bool> - ~english Updates the App Key, which is the unique identifier to access Agora Chat.
-
clearConnectionEventHandlers(
) → void - ~english Clears all connection event handlers. ~end
-
clearMultiDeviceEventHandlers(
) → void - ~english Clears all multi-device event handlers. ~end
-
compressLogs(
) → Future< String> - ~english Compresses the debug log into a gzip archive.
-
fetchLoggedInDevices(
{required String userId, required String token}) → Future< List< ChatDeviceInfo> > - ~english Gets the devices logged in to the specified account by token. ~end
-
getAccessToken(
) → Future< String> - ~english Gets the token of the current logged-in user. ~end
-
getConnectionEventHandler(
String identifier) → ConnectionEventHandler? - ~english Gets the connection event handler.
-
getCurrentDeviceId(
) → Future< String> - ~english Gets the current device ID.
-
getCurrentUserId(
) → Future< String?> - ~english Gets the current login user ID.
-
getMultiDeviceEventHandler(
String identifier) → ChatMultiDeviceEventHandler? - ~english Gets the multi-device event handler.
-
init(
ChatOptions options) → Future< void> - ~english Initializes the SDK.
-
isConnected(
) → Future< bool> - ~english Checks whether the SDK is connected to the chat server.
-
kickAllDevices(
{required String userId, required String token}) → Future< void> - ~english Forces the specified account to log out from all devices by token. ~end
-
kickDevice(
{required String userId, required String token, required String resource}) → Future< void> - ~english Forces the specified account to log out from one device by token. ~end
-
loginWithToken(
String userId, String token) → Future< void> - ~english Logs in to the chat server with a user ID and token. ~end
-
logout(
[bool unbindDeviceToken = true]) → Future< void> - ~english Logs out.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeConnectionEventHandler(
String identifier) → void - ~english Removes the connection event handler.
-
removeMultiDeviceEventHandler(
String identifier) → void - ~english Removes the multi-device event handler.
-
renewToken(
String token) → Future< void> - ~english Renews the token of the current login session. ~end
-
startCallback(
) → Future< void> - ~english Starts contact and group, chatroom callback.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAutoAcceptFriendInvitationSetting(
bool acceptInvitationAlways) → Future< void> -
updateAutoAcceptGroupInvitationSetting(
bool autoAcceptGroupInvitation) → Future< void> -
updateAutoDownloadAttachmentThumbnailSetting(
bool autoDownloadThumbnail) → Future< void> -
updateDeleteMessagesWhenLeaveGroupSetting(
bool deleteMessagesWhenLeaveGroup) → Future< void> -
updateDeleteMessageWhenLeaveRoomSetting(
bool deleteMessageWhenLeaveRoom) → Future< void> -
updateDeliveryAckSetting(
bool requireDeliveryAck) → Future< void> -
updateLoginExtensionInfoSetting(
String extension) → Future< void> - ~english Updates the login extension information. ~end
-
updateMessagesReceiveCallbackIncludeSendSetting(
bool includeSend) → Future< void> -
updateRegradeMessagesAsReadSetting(
bool isRead) → Future< void> -
updateRoomOwnerCanLeaveSetting(
bool roomOwnerCanLeave) → Future< void> -
updateSortMessageByServerTimeSetting(
bool sortMessageByServerTime) → Future< void> -
updateUsingHttpsOnlySetting(
bool usingHttpsOnly) → Future< void>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- getInstance → ChatClient
-
no setter