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 Summary
Modifier and TypeMethodDescriptiondefault voidonConnectionStateChanged(String channelName, RtmConstants.RtmConnectionState state, RtmConstants.RtmConnectionChangeReason reason) Deprecated.This callback is deprecated.default voidonLinkStateEvent(LinkStateEvent event) Occurs when link state changedefault voidonLockEvent(LockEvent event) Occurs when lock state changeddefault voidonMessageEvent(MessageEvent event) Occurs when receive a message.default voidonPresenceEvent(PresenceEvent event) Occurs when remote user presence changeddefault voidonStorageEvent(StorageEvent event) Occurs when receive storage eventdefault voidonTokenEvent(TokenEvent event) Occurs when receive token eventdefault voidonTokenPrivilegeWillExpire(String channelName) Occurs when token will expire in 30 seconds.default voidonTopicEvent(TopicEvent event) Occurs when remote user join/leave topic or when user first join this channel, got snapshot of topics in this channel
-
Method Details
-
onLinkStateEvent
Occurs when link state change- Parameters:
event- details of link state event
-
onMessageEvent
Occurs when receive a message.- Parameters:
event- details of message event.
-
onPresenceEvent
Occurs when remote user presence changed- Parameters:
event- details of presence event.
-
onTopicEvent
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
Occurs when lock state changed- Parameters:
event- details of lock event.
-
onStorageEvent
Occurs when receive storage event- Parameters:
event- details of storage event.
-
onTokenEvent
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
Occurs when token will expire in 30 seconds.- Parameters:
channelName- The name of the channel.
-