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. int? chatAreaCode,
  21. bool enableEmptyConversation = false,
  22. String? deviceName,
  23. int? osType,
  24. bool useReplacedMessageContents = false,
  25. bool enableTLS = false,
  26. bool messagesReceiveCallbackIncludeSend = false,
  27. bool regardImportMessagesAsRead = false,
  28. bool workPathCopiable = false,
  29. String? loginExtension,
  30. Map<String, dynamic>? extSettings,
})

Sets the app options.

Param appId The app Id that you get from the console when creating an app.

Param autoLogin Whether to enable automatic login.

  • (Default) true: Enables automatic login.
  • false: Disables automatic login.

Param debugMode Whether to output the debug information. Make sure to call the method after the ChatClient is initialized.

  • true: Yes.
  • (Default) false: No. Param acceptInvitationAlways Whether to accept friend invitations from other users automatically.
  • true: Yes.
  • (Default) false: No.

Param autoAcceptGroupInvitation Whether to accept group invitations automatically.

  • true: Yes.
  • (Default) false: No.

Param requireAck Whether to require the message read receipt from the recipient.

  • (Default) true: Yes.
  • false: No.

Param requireDeliveryAck Whether the delivery receipt is required. true: Yes. (Default) false: No.

Param deleteMessagesAsExitGroup Whether to delete the related group messages when leaving a group.

  • (Default) true: Yes.
  • false: No.

Param deleteMessagesAsExitChatRoom Whether to delete the related chat room messages when leaving the chat room.

  • (Default) true: Yes.
  • false: No.

Param isChatRoomOwnerLeaveAllowed Whether to allow the chat room owner to leave the chat room.

  • (Default) true: Yes. Even if the chat room owner leaves the chat room, the owner still has all privileges, except for receiving messages in the chat room.
  • false: No.

Param sortMessageByServerTime Whether to sort the messages in the reverse chronological order of the time when they are received by the server.

  • (Default) true: Yes;
  • false: No. Messages are sorted in the reverse chronological order of the time when they are created. Param usingHttpsOnly Whether only HTTPS is used for REST operations.
  • (Default) true: Only HTTPS is supported.
  • false: Both HTTP and HTTPS are allowed.

Param serverTransfer Whether to upload the message attachments automatically to the chat server.

  • (Default) true: Yes.
  • false: No. A custom path is used.

Param isAutoDownloadThumbnail Whether to automatically download the thumbnail.

  • (Default) true: Yes.
  • false: No.

Param enableDNSConfig Whether to enable DNS.

  • (Default) true: Yes.
  • false: No. DNS needs to be disabled for private deployment.

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.

  • true: Yes. Empty conversations are included.
  • (Default) false: No. Empty conversations are excluded.

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.

  • true: Yes.
  • (Default) false: No. The server returns the original message to the sender.

Param enableTLS Whether to enable TLS connection, which takes effect during initialization and is false by default.

Param messagesReceiveCallbackIncludeSend Whether to include the sent message in ChatEventHandler.onMessagesReceived.

Param regardImportMessagesAsRead Whether to regard import messages as read:

  • true: Yes.
  • (Default) false: No.

Param workPathCopiable Whether the SDK work path is copiable, only valid for iOS, default is false.

Implementation

/// Param [usingHttpsOnly] Whether only HTTPS is used for REST operations.
/// - (Default) `true`: Only HTTPS is supported.
/// - `false`: Both HTTP and HTTPS are allowed.
///
/// Param [serverTransfer] Whether to upload the message attachments automatically to the chat server.
/// - (Default) `true`: Yes.
/// - `false`: No. A custom path is used.
///
/// Param [isAutoDownloadThumbnail] Whether to automatically download the thumbnail.
/// - (Default) `true`: Yes.
/// - `false`: No.
///
/// Param [enableDNSConfig] Whether to enable DNS.
/// - (Default) `true`: Yes.
/// - `false`: No. DNS needs to be disabled for private deployment.
///
/// 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.
/// - `true`: Yes. Empty conversations are included.
/// - (Default) `false`: No. Empty conversations are excluded.
///
/// 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.
/// - `true`: Yes.
/// - (Default) `false`: No. The server returns the original message to the sender.
///
/// Param [enableTLS] Whether to enable TLS connection, which takes effect during initialization and is false by default.
///
/// Param [messagesReceiveCallbackIncludeSend] Whether to include the sent message in [ChatEventHandler.onMessagesReceived].
/// - `true`: Yes. Besides the received message, the sent message is also included in [ChatEventHandler.onMessagesReceived].
/// - (Default)`false`: No. Only the received message is included in [ChatEventHandler.onMessagesReceived].
///
/// Param [regardImportMessagesAsRead] Whether to regard import messages as read:
/// - `true`: Yes.
/// - (Default) `false`: No.
///
/// Param [workPathCopiable] Whether the SDK work path is copiable, only valid for iOS, default is false.
///
///
///
///
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,
}) : 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,
        chatAreaCode: chatAreaCode ?? ChatAreaCode.GLOB,
        enableEmptyConversation: enableEmptyConversation,
        deviceName: deviceName,
        osType: osType,
        useReplacedMessageContents: useReplacedMessageContents,
        enableTLS: enableTLS,
        messagesReceiveCallbackIncludeSend:
            messagesReceiveCallbackIncludeSend,
        regardImportMessagesAsRead: regardImportMessagesAsRead,
        workPathCopiable: workPathCopiable,
        loginExtension: loginExtension,
        extSettings: extSettings,
      );