ChatOptions constructor
- 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 = ChatAreaCode.GLOB,
- bool enableEmptyConversation = false,
- String? deviceName,
- int? osType,
- bool useReplacedMessageContents = false,
- bool enableTLS = false,
- bool messagesReceiveCallbackIncludeSend = false,
- bool regardImportMessagesAsRead = false,
Sets the app options.
Param appKey
The app key that you get from the console when creating an app.
Param autoLogin
Whether to enable automatic login.
Param debugMode
Whether to output the debug information. Make sure to call the method after the ChatClient is initialized. See ChatClient.init.
Param acceptInvitationAlways
Whether to accept friend invitations from other users automatically.
Param autoAcceptGroupInvitation
Whether to accept group invitations automatically.
Param requireAck
Whether the read receipt is required.
Param requireDeliveryAck
Whether the delivery receipt is required.
Param deleteMessagesAsExitGroup
Whether to delete the related group messages when leaving a group.
Param deleteMessagesAsExitChatRoom
Whether to delete the related chat room messages when leaving the chat room.
Param isChatRoomOwnerLeaveAllowed
Whether to allow the chat room owner to leave the chat room.
Param sortMessageByServerTime
Whether to sort the messages by the time the server receives messages.
Param usingHttpsOnly
Whether only HTTPS is used for REST operations.
Param serverTransfer
Whether to upload the message attachments automatically to the chat server.
Param isAutoDownloadThumbnail
Whether to automatically download the thumbnail.
Param enableDNSConfig
Whether to enable DNS.
Param dnsUrl
The DNS url.
Param restServer
The REST server for private deployments.
Param imPort
The IM server port for private deployments.
Param imServer
The IM server URL for private deployment.
Param chatAreaCode
The area code.
Param enableEmptyConversation
Whether to include empty conversations when the SDK loads conversations from the local database.
Param deviceName
Custom device name.
Param osType
Custom system type.
Param useReplacedMessageContents
Whether the server returns the sender the text message with the content replaced during text moderation, the default is false.
Param enableTLS
Whether to enable TLS connection, which takes effect during initialization and is false by default.
Param messagesReceiveCallbackIncludeSend
Whether the sent message is included in ChatEventHandler.onMessagesReceived, default is false.
Param regardImportMessagesAsRead
Whether to regard import messages as read, default is false.
Implementation
ChatOptions({
required this.appKey,
this.autoLogin = true,
this.debugMode = false,
this.acceptInvitationAlways = false,
this.autoAcceptGroupInvitation = false,
this.requireAck = true,
this.requireDeliveryAck = false,
this.deleteMessagesAsExitGroup = true,
this.deleteMessagesAsExitChatRoom = true,
this.isChatRoomOwnerLeaveAllowed = true,
this.sortMessageByServerTime = true,
this.usingHttpsOnly = true,
this.serverTransfer = true,
this.isAutoDownloadThumbnail = true,
this.enableDNSConfig = true,
this.dnsUrl,
this.restServer,
this.imPort,
this.imServer,
this.chatAreaCode = ChatAreaCode.GLOB,
this.enableEmptyConversation = false,
this.deviceName,
this.osType,
this.useReplacedMessageContents = false,
this.enableTLS = false,
this.messagesReceiveCallbackIncludeSend = false,
this.regardImportMessagesAsRead = false,
});