Interface IRtmEventHandler

The IRtmEventHandler class.

The SDK uses this class to send callback event notifications to the app, and the app inherits the methods in this class to retrieve these event notifications.

All methods in this class have their default (empty) implementations, and the app can inherit only some of the required events instead of all. In the callback methods, the app should avoid time-consuming tasks or calling blocking APIs, otherwise the SDK may not work properly.

Hierarchy

  • IRtmEventHandler

Methods

  • Occurs when user acquire a lock

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockName: string

      The name of the lock.

    • errorCode: ErrorCode

      The error code.

    • errorDetails: string

      The details of error.

    Returns void

  • Parameters

    Returns void

    Deprecated

    This callback is deprecated. Use LinkStateEvent instead. Occurs when the connection state changes between rtm sdk and agora service.

  • Occurs when user try to get the channel metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • data: Metadata

      The result metadata of getting operation.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when get history messages

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • messageList: HistoryMessage[]

      The history message list.

    • count: number

      The message count.

    • newStart: number

      The timestamp of next history message. If newStart is 0, means there are no more history messages

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user try to get locks from the channel

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockDetailList: LockDetail[]

      The details of the locks.

    • count: number

      The count of the locks.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when query who joined this channel

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userStateList: UserState[]
    • count: number

      The user count.

    • nextPage: string

      The next page.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user call get subscribe user list.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • topic: string

      The name of the topic.

    • users: UserList

      The subscribed user list.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when query which channels the user joined

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channels: ChannelInfo[]

      The channel informations.

    • count: number

      The channel count.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user try to get the user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • data: Metadata

      The result metadata of getting operation.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user join a stream channel.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user join topic.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • userId: string

      The id of the user.

    • topic: string

      The name of the topic.

    • meta: string

      The meta of the topic.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user leave a stream channel.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user leave topic.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • userId: string

      The id of the user.

    • topic: string

      The name of the topic.

    • meta: string

      The meta of the topic.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user login.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user logout.

    Parameters

    • requestId: number

      The related request id when user perform this operation.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when get user presence

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • state: UserState
    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when delete user presence

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when set user presence

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user publish message.

    Parameters

    • requestId: number

      The related request id when user publish message

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user publish topic message.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • topic: string

      The name of the topic.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user release a lock

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockName: string

      The name of the lock.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user removing the channel metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user delete a lock

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockName: string

      The name of the lock.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user removing the user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user renew token.

    Parameters

    • requestId: number

      The related request id when user renew token.

    • serverType: RtmServiceType

      The type of server.

    • channelName: string

      The name of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user revoke a lock

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockName: string

      The name of the lock.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user setting the channel metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user set a lock

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • lockName: string

      The name of the lock.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user setting the user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when subscribe a channel

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user subscribe topic.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • userId: string

      The id of the user.

    • topic: string

      The name of the topic.

    • succeedUsers: UserList

      The subscribed users.

    • failedUsers: UserList
    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user subscribe a user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when token will expire in 30 seconds.

    Parameters

    • channelName: string

      The name of the channel.

    Returns void

  • Occurs when remote user join/leave topic or when user first join this channel, got snapshot of topics in this channel

    Parameters

    Returns void

  • Occurs when unsubscribe a channel

    Parameters

    • requestId: number

      The related request id when user unsubscribe.

    • channelName: string

      The name of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user call unsubscribe topic.

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • topic: string

      The name of the topic.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user unsubscribe a user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user updating the channel metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channelName: string

      The name of the channel.

    • channelType: RtmChannelType

      The type of the channel.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when user updating the user metadata

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userId: string

      The id of the user.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when query which channels the user joined

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • channels: ChannelInfo[]

      The channel informations.

    • count: number

      The channel count.

    • errorCode: ErrorCode

      The error code.

    Returns void

  • Occurs when query who joined this channel

    Parameters

    • requestId: number

      The related request id when user perform this operation

    • userStateList: UserState[]
    • count: number

      The user count.

    • nextPage: string

      The next page.

    • errorCode: ErrorCode

      The error code.

    Returns void