ChatOptions class

SDK 聊天相关的设置。

Constructors

ChatOptions({required String appKey, bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, 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, String? webSocketServer, int? webSocketPort, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, bool enableUserInfo = false, int? dataSyncType, String? loginExtension, List<String>? ntpServers, String? apnsCertName, String? pushKitCertName})
设置 SDK Param appKey 创建 app 时在 console 后台上注册的 app 唯一识别符。
ChatOptions.withAppId(String appId, {bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, 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, String? webSocketServer, int? webSocketPort, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, bool enableUserInfo = false, int? dataSyncType, String? loginExtension, List<String>? ntpServers, String? apnsCertName, String? pushKitCertName, Map<String, dynamic>? extSettings})
设置 SDK Param appKey 创建 app 时在 console 后台上注册的 app 唯一识别符。
ChatOptions.withAppKey(String appKey, {bool debugMode = false, bool acceptInvitationAlways = false, bool autoAcceptGroupInvitation = false, 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, String? webSocketServer, int? webSocketPort, int? chatAreaCode, bool enableEmptyConversation = false, String? deviceName, int? osType, bool useReplacedMessageContents = false, bool enableTLS = false, bool messagesReceiveCallbackIncludeSend = false, bool regardImportMessagesAsRead = false, bool workPathCopiable = false, bool enableUserInfo = false, int? dataSyncType, String? loginExtension, List<String>? ntpServers, String? apnsCertName, String? pushKitCertName, Map<String, dynamic>? extSettings})
设置 SDK Param appKey 创建 app 时在 console 后台上注册的 app 唯一识别符。

Properties

acceptInvitationAlways → bool
是否自动接受加好友邀请。
final
apnsCertName → String?
APNs 推送证书名称,用于 iOS 的离线推送。
final
appId → String?
创建 app 时在 console 后台上注册的 app 唯一识别符。
final
appKey → String?
创建 app 时在 console 后台上注册的 app 唯一识别符。
final
autoAcceptGroupInvitation → bool
是否自动接受群组邀请。
final
chatAreaCode → int
区号 此属性用于限制可访问边缘节点的范围。缺省值为AreaCodeGLOB。 此属性只能在调用ChatClient.init时设置。在应用程序运行期间不能更改属性设置。
final
dataSyncType → int?
登录后自动同步的数据类型。多个 ChatDataSyncType 值可使用按位或组合。 未设置时使用 native 平台默认值。
final
debugMode → bool
是否输出调试信息,在 ChatClient 初始化完成后调用,详见 ChatClient.init。
final
deleteMessagesAsExitChatRoom → bool
离开聊天室时是否删除消息。
final
deleteMessagesAsExitGroup → bool
离开群组时是否删除消息。
final
deviceName → String?
自定义设备名称。
final
dnsUrl → String?
DNS 地址。
final
enableDNSConfig → bool
是否开启 DNS。
final
enableEmptyConversation → bool
从本地数据库加载会话时是否包括空会话。
final
enableTLS → bool
是否开启 TLS 连接,初始化时生效,默认为 false。
final
enableUserInfo → bool
是否开启用户属性功能。
final
hashCode → int
The hash code for this object.
no setterinherited
imPort → int?
是否使用自定义 IM 服务的端口。用于私有化部署。
final
imServer → String?
消息服务器。
final
isAutoDownloadThumbnail → bool
是否自动下载缩略图。
final
isChatRoomOwnerLeaveAllowed → bool
是否允许聊天室所有者离开聊天室。
final
loginExtension → String?
登录时携带的扩展信息,可以是JSON 字符串,目前字符串长度 底层限制长度1024
final
messagesReceiveCallbackIncludeSend → bool
发送的消息是会执行 ChatEventHandler.onMessagesReceived 回调。
final
ntpServers → List<String>?
自定义 NTP 服务器列表,用于 SDK 校准时间。
final
osType → int?
自定义系统类型。
final
pushKitCertName → String?
PushKit 推送证书名称,用于 iOS 的 VoIP 推送。
final
regardImportMessagesAsRead → bool
是否将导入的消息视为已读。
final
requireDeliveryAck → bool
/// 是否发送消息已送达回执。
final
restServer → String?
REST 服务器。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverTransfer → bool
是否自动将消息附件上传到聊天服务器。
final
sortMessageByServerTime → bool
是否根据服务器收到消息的时间对消息进行排序。
final
useReplacedMessageContents → bool
是否在文本审核时,返回给发送者被替换内容的文本消息:
final
usingHttpsOnly → bool
是否只用 HTTPS。
final
webSocketPort → int?
WebSocket 服务器端口。
final
webSocketServer → String?
WebSocket 服务器地址。
final
workPathCopiable → bool
SDK 的工作路径是否可备份, 只有ios生效,默认为 false。
final

Methods

copyWith({bool? usingHttpsOnly, String? loginExtension, bool? deleteMessageWhenLeaveRoom, bool? deleteMessagesWhenLeaveGroup, bool? roomOwnerCanLeave, bool? autoAcceptGroupInvitation, bool? acceptInvitationAlways, bool? autoDownloadThumbnail, bool? requireDeliveryAck, bool? sortMessageByServerTime, bool? messagesReceiveCallbackIncludeSend, bool? regardImportMessagesAsRead, int? dataSyncType, Map<String, dynamic>? extSettings}) → ChatOptions
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