Options
All
  • Public
  • Public/Protected
  • All
Menu

Presence contains APIs for presence operations.

Index

Functions

  • publishPresence(this: Connection, params: { description: string; error?: any; success?: any }): Promise<void>
  • Publishes a custom presence state.

    connection.publishPresence({description: 'music'})
    

    Parameters

    • this: Connection
    • params: { description: string; error?: any; success?: any }
      • description: string

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

      • error?:function
      • success?:function
        • success(): void
        • Returns void

    Returns Promise<void>

  • Subscribes to a user's presence states. If the subscription succeeds, the subscriber will receive the callback when the user's presence state changes.

    connection.subscribePresence({usernames: ['user1','user2'], expiry: 10000})
    

    Parameters

    Returns Promise<AsyncResult<SubscribePresenceResult>>

  • unsubscribePresence(this: Connection, params: { usernames: string[]; error?: any; success?: any }): Promise<void>
  • Unsubscribes from a user's presence states.

    connection.unsubscribePresence({usernames: ['user1','user2']})
    

    Parameters

    • this: Connection
    • params: { usernames: string[]; error?: any; success?: any }
      • usernames: string[]

        The array of IDs of users whose presence states you want to unsubscribe from.

      • error?:function
      • success?:function
        • success(): void
        • Returns void

    Returns Promise<void>

Generated using TypeDoc