Package io.agora.rtm

Interface RtmEventListener


public interface RtmEventListener
The RtmEventListener 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.
  • Method Details

    • onLinkStateEvent

      default void onLinkStateEvent(LinkStateEvent event)
      Occurs when link state change
      Parameters:
      event - details of link state event
    • onMessageEvent

      default void onMessageEvent(MessageEvent event)
      Occurs when receive a message.
      Parameters:
      event - details of message event.
    • onPresenceEvent

      default void onPresenceEvent(PresenceEvent event)
      Occurs when remote user presence changed
      Parameters:
      event - details of presence event.
    • onTopicEvent

      default void onTopicEvent(TopicEvent event)
      Occurs when remote user join/leave topic or when user first join this channel, got snapshot of topics in this channel
      Parameters:
      event - details of topic event.
    • onLockEvent

      default void onLockEvent(LockEvent event)
      Occurs when lock state changed
      Parameters:
      event - details of lock event.
    • onStorageEvent

      default void onStorageEvent(StorageEvent event)
      Occurs when receive storage event
      Parameters:
      event - details of storage event.
    • onTokenEvent

      default void onTokenEvent(TokenEvent event)
      Occurs when receive token event
      Parameters:
      event - details of token event.
    • onConnectionStateChanged

      @Deprecated default void onConnectionStateChanged(String channelName, RtmConstants.RtmConnectionState state, RtmConstants.RtmConnectionChangeReason reason)
      Deprecated.
      This callback is deprecated. Use LinkStateEvent instead.
      Occurs when the connection state changes between rtm sdk and agora server.
      Parameters:
      channelName - The Name of the channel.
      state - The new connection state.
      reason - The reason for the connection state change.
    • onTokenPrivilegeWillExpire

      default void onTokenPrivilegeWillExpire(String channelName)
      Occurs when token will expire in 30 seconds.
      Parameters:
      channelName - The name of the channel.