Options
All
  • Public
  • Public/Protected
  • All
Menu

export manager

Hierarchy

  • Native
    • ChatPresenceManager

Index

Constructors

Properties

_presenceListeners: Set<ChatPresenceEventListener>
_presenceSubscriptions: Map<string, EmitterSubscription>
TAG: string = 'ChatPresenceManager'

Methods

  • fetchPresenceStatus(members: string[]): Promise<ChatPresence[]>
  • Gets the current presence state of specified users.

    throws

    A description of the exception. See ChatError.

    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.

  • fetchSubscribedMembers(pageNum?: number, pageSize?: number): Promise<string[]>
  • Uses the pagination to get a list of users whose presence states you have subscribed to.

    throws

    A description of the exception. See ChatError.

    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.

  • invokePresenceListener(params: any): void
  • Parameters

    • params: any

    Returns void

  • publishPresence(description?: string): Promise<void>
  • Publishes a custom presence state.

    throws

    A description of the exception. See ChatError.

    Parameters

    • Optional description: string

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

    Returns Promise<void>

  • removeAllPresenceListener(): void
  • Clears all presence listeners.

    Returns void

  • setNativeListener(event: NativeEventEmitter): void
  • Parameters

    • event: NativeEventEmitter

    Returns void

  • subscribe(members: string[], expiry: number): Promise<ChatPresence[]>
  • 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.

    throws

    A description of the exception. See ChatError.

    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.

  • unsubscribe(members: string[]): Promise<void>
  • Unsubscribes from the presence state of the unspecified users.

    throws

    A description of the exception. See ChatError.

    Parameters

    • members: string[]

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

    Returns Promise<void>

  • _callMethod<T>(method: string, args?: {}): Promise<T>
  • Type Parameters

    • T

    Parameters

    • method: string
    • Optional args: {}

      Returns Promise<T>

    • checkErrorFromResult(result: any): void
    • Parameters

      • result: any

      Returns void

    Generated using TypeDoc