ChatOptions.withAppId constructor

ChatOptions.withAppId(
  1. String appId, {
  2. bool autoLogin = true,
  3. bool debugMode = false,
  4. bool acceptInvitationAlways = false,
  5. bool autoAcceptGroupInvitation = false,
  6. bool requireAck = true,
  7. bool requireDeliveryAck = false,
  8. bool deleteMessagesAsExitGroup = true,
  9. bool deleteMessagesAsExitChatRoom = true,
  10. bool isChatRoomOwnerLeaveAllowed = true,
  11. bool sortMessageByServerTime = true,
  12. bool usingHttpsOnly = true,
  13. bool serverTransfer = true,
  14. bool isAutoDownloadThumbnail = true,
  15. bool enableDNSConfig = true,
  16. String? dnsUrl,
  17. String? restServer,
  18. int? imPort,
  19. String? imServer,
  20. String? webSocketServer,
  21. int? webSocketPort,
  22. int? chatAreaCode,
  23. bool enableEmptyConversation = false,
  24. String? deviceName,
  25. int? osType,
  26. bool useReplacedMessageContents = false,
  27. bool enableTLS = false,
  28. bool messagesReceiveCallbackIncludeSend = false,
  29. bool regardImportMessagesAsRead = false,
  30. bool workPathCopiable = false,
  31. bool enableUserInfo = false,
  32. bool enableAutoSyncContacts = false,
  33. String? loginExtension,
  34. Map<String, dynamic>? extSettings,
})

设置 SDK Param appKey 创建 app 时在 console 后台上注册的 app 唯一识别符。

Param autoLogin 是否开启自动登录。

  • (默认)true:是;
  • false:否。

Param debugMode 是否输出调试信息,在 ChatClient 初始化完成后调用,详见 ChatClient.init

  • true:SDK 会在 log 里输出调试信息;
  • (默认)false:不会输出调试信息。

Param acceptInvitationAlways 是否自动接受加好友邀请。

  • (默认)true:是;
  • false:否。

Param autoAcceptGroupInvitation 是否自动接受群组邀请。

  • true:是;
  • (默认)false:否。

Param requireAck 是否发送已读回执。

  • (默认)true:是;
  • false:否。

Param requireDeliveryAck 是否发送已送达回执。

  • (默认)true:是;
  • false:否。

Param deleteMessagesAsExitGroup 是否在离开群组时删除群组历史消息。

  • (默认)true:是;
  • false:否。

Param deleteMessagesAsExitChatRoom 是否在离开聊天室时删除聊天历史消息。

  • (默认)true:是;
  • false:否。

Param isChatRoomOwnerLeaveAllowed 是否允许聊天室所有者离开聊天室。

  • (默认)true:是;
  • false:否。

Param sortMessageByServerTime 是否根据服务器收到消息的时间对消息进行排序。

  • (默认)true:是;
  • false:否。

Param usingHttpsOnly 是否只使用 HTTPS。

  • (默认)true:是;
  • false:否。

Param serverTransfer 是否自动将消息附件上传到聊天服务器。

  • (默认)true:是;
  • false:否。

Param isAutoDownloadThumbnail 是否自动下载缩略图。

  • (默认)true:是;
  • false:否。

Param enableDNSConfig 设置是否开启 DNS。

  • (默认)true:是;
  • false:否。

Param dnsUrl DNS 地址。

Param restServer 私有部署时的 REST 服务器地址。

Param imPort 私有部署时的 IM 服务器端口。

Param imServer 私有部署时的 IM 服务器地址。

Param webSocketServer 私有部署时的 WebSocket 服务器地址。

Param webSocketPort 私有部署时的 WebSocket 服务器端口。

Param chatAreaCode server 区域码.

Param enableEmptyConversation 从本地数据库加载会话时是否包括空会话。

  • true:包含空会话;
  • (默认)false:不包含空会话。

Param deviceName 自定义设备名称。

Param osType 自定义系统类型。

Param useReplacedMessageContents 是否在文本审核时,返回给发送者被替换内容的文本消息。

  • true:将内容替换后的消息返回给发送方。
  • (默认)false:将原消息返回给发送方。

Param enableTLS 是否开启 TLS 连接,初始化时生效,默认为 false。

Param messagesReceiveCallbackIncludeSend 发送的消息是会执行 ChatEventHandler.onMessagesReceived 回调。

  • true:是。接收消息通知中包含发送成功的消息。
  • (默认)false:否。接收消息通知中只包含接收的消息。

Param regardImportMessagesAsRead 是否将导入的消息视为已读, 默认为 false。

Param workPathCopiable 是否允许复制工作路径到其他地方,只有ios生效,默认为 false。

Implementation

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,
  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,
  bool enableAutoSyncContacts = false,
  String? loginExtension,
  Map<String, dynamic>? extSettings,
}) : this._(
        appId: appId,
        autoLogin: autoLogin,
        debugMode: debugMode,
        acceptInvitationAlways: acceptInvitationAlways,
        autoAcceptGroupInvitation: autoAcceptGroupInvitation,
        requireAck: requireAck,
        requireDeliveryAck: requireDeliveryAck,
        deleteMessagesAsExitGroup: deleteMessagesAsExitGroup,
        deleteMessagesAsExitChatRoom: deleteMessagesAsExitChatRoom,
        isChatRoomOwnerLeaveAllowed: isChatRoomOwnerLeaveAllowed,
        sortMessageByServerTime: sortMessageByServerTime,
        usingHttpsOnly: usingHttpsOnly,
        serverTransfer: serverTransfer,
        isAutoDownloadThumbnail: isAutoDownloadThumbnail,
        enableDNSConfig: enableDNSConfig,
        dnsUrl: dnsUrl,
        restServer: restServer,
        imPort: imPort,
        imServer: imServer,
        webSocketServer: webSocketServer,
        webSocketPort: webSocketPort,
        chatAreaCode: chatAreaCode ?? ChatAreaCode.GLOB,
        enableEmptyConversation: enableEmptyConversation,
        deviceName: deviceName,
        osType: osType,
        useReplacedMessageContents: useReplacedMessageContents,
        enableTLS: enableTLS,
        messagesReceiveCallbackIncludeSend:
            messagesReceiveCallbackIncludeSend,
        regardImportMessagesAsRead: regardImportMessagesAsRead,
        workPathCopiable: workPathCopiable,
        enableUserInfo: enableUserInfo,
        enableAutoSyncContacts: enableAutoSyncContacts,
        loginExtension: loginExtension,
        extSettings: extSettings,
      );