Occurs when the connection state changes between the SDK and the Agora RTM system.
Occurs when the local user receives a peer-to-peer message from a remote user.
Occurs when the callee receives a call invitation from a remote user (caller).
Occurs when the SDK automatically switches to proxy WebSocket of 443 port.
Occurs when the online status of the peers, to whom you subscribe, changes.
Occurs when the RTM server detects that the RTM token has exceeded the specified validity period.
CONNECTED
state, the connection state switches
to ABORTED
and you need to call the
login method to log in again.
RECONNECTING
state, you will receive this
callback when the network reconnects and you need to call
renewToken to pass the new
token on to the server.
Occurs when the token expires in 30 seconds.
Event listener type of the RtmClient instance. In this interface, the function property’s name is the event name; the function property’s parameters is the parameters of the event listener function.
Listening to peer-to-peer messages.
client.on('MessageFromPeer', function (message, peerId) { // Your code. });