Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Connection

Index

Constructors

Properties

_reportInterval: number = ...
_reportLogs: boolean = false
apiUrl: string

The URL of the specified REST server. The URL is used when DNS is not enabled. Usually, this URL is used by specific customers who expects to implement data isolation for strict data security. To get the URL, contact our account manager.

appKey: string

Your App Key.

autoReconnectNumMax: number

The maximum number of reconnection attempts allowed. The default value is 5.

delivery: boolean

Whether to enable the receipt of delivery. - true: Enable; - (Default)false: Disable.

deviceId: string

The device ID.

enableReportLogs: boolean = false

Does the mini program platform allow uploading logs - True: enabled False: Close - (default).

eventHandler?: EventHandler
heartBeatWait: number

The heartbeat interval (in millisecond). By default, it is 30000 ms.

https: boolean

Whether to use HTTPS only. By default, the browser determines whether to use HTTPS only according to the domain name.

isDebug: boolean
isFixedDeviceId?: boolean

Whether to use a fixed device ID (deviceId).
- (Default) true: The SDK generates a device ID for a browser and saves it to the local storage. Then in the browser, all SDK instances use the same device.
-false: A random device ID is used for connections of each SDK instance. That is to say, each SDK instance uses a different device for connections.
This parameter has an impact on the kicking policy during a multi-device login scenario.

isHttpDNS: boolean

Whether to enable DNS. - (Default)true: Enable; - false: Disable.

name: string = 'connection'
token: string

The user token for login.

url: string

The URL of the specified message server. Usually, this URL is used by specific customers who expects to implement data isolation for strict data security. To get the URL, contact our account manager.

useOwnUploadFun: boolean

Whether to use your own upload function, for example, when uploading images and files to your own server.

useReplacedMessageContents: boolean

When the moderation service replaces the content of a message, whether the adjusted message is returned to the sender. - true: Return the adjusted message to the sender. - false: Return the original message to the sender.

version: string

The SDK version.

Methods

  • Registers the listener function.

    Parameters

    Returns void

  • close(): void
  • Closes the connection.

    Returns void

  • getDNS(): Promise<unknown>
  • Returns Promise<unknown>

  • isOpened(): boolean
  • Checks the connection status. - true: Connected; - (Default)false: Disconnected.

    Returns boolean

  • removeEventHandler(id: string): void
  • Removes the listener function.

    Parameters

    • id: string

    Returns void

  • Updates the token.

    Parameters

    • token: string

    Returns Promise<NewTokenResult>

  • setLoginInfoCustomExt(ext: string): void
  • Set custom extensions for login information. When a multi-device login is kicked, the custom extension information will be passed to the kicked device.

    Parameters

    • ext: string

    Returns void

Generated using TypeDoc