The presence manager class.

Hierarchy

  • Native
    • ChatPresenceManager

Constructors

Methods

  • Adds a presence listener.

    Parameters

    Returns void

  • Gets the current presence state of specified users.

    Parameters

    • members: string[]

      The array of user IDs whose current presence state you want to check.

    Returns Promise<ChatPresence[]>

    The current presence states of the specified users.

    A description of the exception. See ChatError.

  • Uses the pagination to get a list of users whose presence states you have subscribed to.

    Parameters

    • pageNum: number = 1

      The current page number, starting from 1.

    • pageSize: number = 20

      The number of subscribed users that you expect to get on each page.

    Returns Promise<string[]>

    The user IDs of your subscriptions. The SDK returns null if you does not subscribe to the presence state of any users.

    A description of the exception. See ChatError.

  • Publishes a custom presence state.

    Parameters

    • Optionaldescription: string

      The extension information of the presence state. It can be set as nil.

    Returns Promise<void>

    A description of the exception. See ChatError.

  • Clears all presence listeners.

    Returns void

  • Removes a presence listener.

    Parameters

    Returns void

  • Parameters

    • event: NativeEventEmitter

    Returns void

  • Subscribes to the presence state of a user.

    If the subscription succeeds, the subscriber will receive the callback when the presence state of the user changes.

    Parameters

    • members: string[]

      The array of user IDs users whose presence state you want to subscribe to.

    • expiry: number

      The subscription duration in seconds. The duration cannot exceed 2,592,000 (30×24×3600) seconds, i.e., 30 days.

    Returns Promise<ChatPresence[]>

    The current presence state of users to whom you have subscribed.

    A description of the exception. See ChatError.

  • Unsubscribes from the presence state of the unspecified users.

    Parameters

    • members: string[]

      The array of user IDs whose presence state you want to unsubscribe from.

    Returns Promise<void>

    A description of the exception. See ChatError.

  • Type Parameters

    • T

    Parameters

    • method: string
    • Optionalargs: {}

      Returns Promise<T>

    • Parameters

      • result: any

      Returns void