Public Member Functions

void onConnectionStateChanged (int state, int reason)
 
void onMessageReceived (RtmMessage message, String peerId)
 
void onTokenExpired ()
 

Detailed Description

Callbacks for the Agora RTM client methods.

Member Function Documentation

◆ onConnectionStateChanged()

void io.agora.rtm.RtmClientListener.onConnectionStateChanged ( int  state,
int  reason 
)

Occurs when the connection state between the SDK and the Agora RTM system changes.

Parameters
stateThe new connection state. See ConnectionState.
reasonThe reason for the connection state change. See ConnectionChangeReason.

◆ onMessageReceived()

void io.agora.rtm.RtmClientListener.onMessageReceived ( RtmMessage  message,
String  peerId 
)

Occurs when the local user receives a peer-to-peer message.

Parameters
messageThe received message. See RtmMessage.
peerIdThe user ID of the message sender.

◆ onTokenExpired()

void io.agora.rtm.RtmClientListener.onTokenExpired ( )

Occurs when the token expires.

This callback occurs when the token expires and reminds the user to renew it. When receiving this callback, generate a new Token on the server and call the renewToken method to pass the new Token on to the server.