ChatOptions class
The ChatOptions class, which contains the settings of the Chat SDK.
For example, whether to encrypt the messages before sending and whether to automatically accept the friend invitations.
Constructors
- ChatOptions.new({required String appKey, bool autoLogin = true, bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, bool requireAck = true, bool requireDeliveryAck = false, bool deleteMessagesAsExitGroup = true, bool deleteMessagesAsExitChatRoom = true, bool isChatRoomOwnerLeaveAllowed = true, bool sortMessageByServerTime = true, bool usingHttpsOnly = true, bool serverTransfer = true, bool isAutoDownloadThumbnail = true, bool enableDNSConfig = true, String? dnsUrl, String? restServer, int? imPort, String? imServer, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, String? loginExtension})
- Sets the app options.
-
ChatOptions.withAppId(String appId, {bool autoLogin = true, bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, bool requireAck = true, bool requireDeliveryAck = false, bool deleteMessagesAsExitGroup = true, bool deleteMessagesAsExitChatRoom = true, bool isChatRoomOwnerLeaveAllowed = true, bool sortMessageByServerTime = true, bool usingHttpsOnly = true, bool serverTransfer = true, bool isAutoDownloadThumbnail = true, bool enableDNSConfig = true, String? dnsUrl, String? restServer, int? imPort, String? imServer, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, String? loginExtension, Map<
String, dynamic> ? extSettings}) - Sets the app options.
-
ChatOptions.withAppKey(String appKey, {bool autoLogin = true, bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, bool requireAck = true, bool requireDeliveryAck = false, bool deleteMessagesAsExitGroup = true, bool deleteMessagesAsExitChatRoom = true, bool isChatRoomOwnerLeaveAllowed = true, bool sortMessageByServerTime = true, bool usingHttpsOnly = true, bool serverTransfer = true, bool isAutoDownloadThumbnail = true, bool enableDNSConfig = true, String? dnsUrl, String? restServer, int? imPort, String? imServer, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, String? loginExtension, Map<
String, dynamic> ? extSettings}) - Sets the app options.
Properties
- acceptInvitationAlways → bool
-
Whether to accept friend invitations from other users automatically.
final
- appId → String?
-
The app key that you get from the console when creating the app.
final
- appKey → String?
-
The app key that you get from the console when creating the app.
final
- autoAcceptGroupInvitation → bool
-
Whether to accept group invitations automatically.
final
- autoLogin → bool
-
Whether to enable automatic login.
final
- chatAreaCode → int
-
The area code.
This attribute is used to restrict the scope of accessible edge nodes. The default value is
AreaCodeGLOB. This attribute can be set only when you call ChatClient.init. The attribute setting cannot be changed during the app runtime.final - debugMode → bool
-
Whether to output the debug information. Make sure to call the method after initializing the ChatClient using ChatClient.init.
final
- deleteMessagesAsExitChatRoom → bool
-
Whether to delete the chat room messages when leaving the chat room.
final
- deleteMessagesAsExitGroup → bool
-
Whether to delete the group messages when leaving a group.
final
- deviceName → String?
-
Custom device name.
final
- dnsUrl → String?
-
The DNS URL.
final
- enableDNSConfig → bool
-
Whether to enable DNS.
final
- enableEmptyConversation → bool
-
Whether to include empty conversations when the SDK loads conversations from the local database:
final
- enableTLS → bool
-
Whether to enable TLS connection, which takes effect during initialization and is false by default.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imPort → int?
-
The custom IM server port.
final
- imServer → String?
-
The custom IM message server url.
final
- isAutoDownloadThumbnail → bool
-
Whether to automatically download the thumbnail.
final
- isChatRoomOwnerLeaveAllowed → bool
-
Whether to allow the chat room owner to leave the chat room.
final
- loginExtension → String?
-
The extended information carried during login can be a JSON string. The current string length is limited to 1024 characters.
final
- messagesReceiveCallbackIncludeSend → bool
-
Whether the sent message is included in ChatEventHandler.onMessagesReceived:
final
- osType → int?
-
Custom system type.
final
- regardImportMessagesAsRead → bool
-
Whether to regard import messages as read.
final
- requireAck → bool
-
Whether to require read receipt after sending a message.
final
- requireDeliveryAck → bool
-
Whether to require the delivery receipt after sending a message.
final
- restServer → String?
-
The custom REST server.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverTransfer → bool
-
Whether to upload the message attachments automatically to the chat server.
final
- sortMessageByServerTime → bool
-
Whether to sort the messages by the time when the messages are received by the server.
final
- useReplacedMessageContents → bool
-
Whether the server returns the sender the text message with the content replaced during text moderation:
final
- usingHttpsOnly → bool
-
Whether only HTTPS is used for REST operations.
final
- workPathCopiable → bool
-
Whether the SDK work path is copiable, only valid for iOS, default is false.
final
Methods
-
copyWith(
{bool? usingHttpsOnly, String? loginExtension, bool? deleteMessageWhenLeaveRoom, bool? deleteMessagesWhenLeaveGroup, bool? roomOwnerCanLeave, bool? autoAcceptGroupInvitation, bool? acceptInvitationAlways, bool? autoDownloadThumbnail, bool? requireDeliveryAck, bool? requireAck, bool? sortMessageByServerTime, bool? messagesReceiveCallbackIncludeSend, bool? regardImportMessagesAsRead, Map< String, dynamic> ? extSettings}) → ChatOptions -
enableAPNs(
String certName) → void - Enables Apple Push Notification service (APNs) on iOS devices.
-
enableFCM(
String appId) → void - Enables Firebase Cloud Messaging (FCM) push on devices that support Google Play.
-
enableHonorPush(
) → void - Enables Honor Push on Honor devices.
-
enableHWPush(
) → void - Enables Huawei Push on Huawei devices.
-
enableMeiZuPush(
String appId, String appKey) → void -
Enables MeiZu Push on MeiZu devices.
Param
appIdThe app ID for MeiZu Push. ParamappKeyThe app key for MeiZu Push. -
enableMiPush(
String appId, String appKey) → void - Enables Mi Push on Mi devices.
-
enableOppoPush(
String appKey, String secret) → void - Enables OPPO PUSH on OPPO devices.
-
enableVivoPush(
bool agreePrivacyStatement) → void - Enables vivo Push on vivo devices.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited