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 current RTM Token exceeds the 24-hour validity period.
This callback occurs when the current RTM Token exceeds the 24-hour validity period and reminds the user to renew it. When receiving this callback, generate a new RTM Token on the server and call the renewToken method to pass the new Token on to the server.
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. });