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 24-hour validity period and when the SDK is in the RECONNECTING
state.
CONNECTED
state.The currently used RTM Token login permission will expire after 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. });