Signaling (previously RTM) SDK v1.5.0 API Reference for Android
|
Public Member Functions |
|
void | onConnectionStateChanged (int state, int reason) |
void | onMessageReceived (RtmMessage message, String peerId) |
void | onImageMessageReceivedFromPeer (RtmImageMessage message, String peerId) |
void | onFileMessageReceivedFromPeer (RtmFileMessage message, String peerId) |
void | onMediaUploadingProgress (RtmMediaOperationProgress progress, long requestId) |
void | onMediaDownloadingProgress (RtmMediaOperationProgress progress, long requestId) |
void | onTokenExpired () |
void | onTokenPrivilegeWillExpire () |
void | onPeersOnlineStatusChanged (Map< String, Integer > peersStatus) |
Callbacks for the Agora RTM client methods.
void io.agora.rtm.RtmClientListener.onConnectionStateChanged | ( | int | state, |
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora RTM system changes.
state |
The new connection state. See
ConnectionState .
|
reason |
The reason for the connection state change. See
ConnectionChangeReason .
|
void io.agora.rtm.RtmClientListener.onMessageReceived | ( | RtmMessage | message, |
String | peerId | ||
) |
Occurs when the local user receives a peer-to-peer message.
message |
The received message. See
RtmMessage .
|
peerId | The user ID of the message sender. |
void io.agora.rtm.RtmClientListener.onImageMessageReceivedFromPeer | ( | RtmImageMessage | message, |
String | peerId | ||
) |
Occurs when the local user receives a peer-to-peer image message.
message |
The received image message. See
RtmImageMessage .
|
peerId | The user ID of the message sender. |
void io.agora.rtm.RtmClientListener.onFileMessageReceivedFromPeer | ( | RtmFileMessage | message, |
String | peerId | ||
) |
Occurs when the local user receives a peer-to-peer file message.
message |
The received file message. See
RtmFileMessage .
|
peerId | The user ID of the message sender. |
void io.agora.rtm.RtmClientListener.onMediaUploadingProgress | ( | RtmMediaOperationProgress | progress, |
long | requestId | ||
) |
Active callback: Reports the upload progress.
progress |
Upload progress of a file or image. See
RtmMediaOperationProgress .
|
requestId | Unique ID for the upload request. |
void io.agora.rtm.RtmClientListener.onMediaDownloadingProgress | ( | RtmMediaOperationProgress | progress, |
long | requestId | ||
) |
Active callback: Reports the download progress.
progress |
Download progress of a file or image. See
RtmMediaOperationProgress .
|
requestId | Unique ID for the download request. |
void io.agora.rtm.RtmClientListener.onTokenExpired | ( | ) |
Occurs when the RTM server detects that the RTM token has exceeded the specified validity period.
CONNECTION_STATE_CONNECTED
state, the connection
state switches to CONNECTION_STATE_ABORTED
and you need to call the
login
method to log in again.
CONNECTION_STATE_RECONNECTING
state, you will
receive this callback when the network reconnects and you need to call the
renewToken
method to pass the new Token on to the server.
void io.agora.rtm.RtmClientListener.onTokenPrivilegeWillExpire | ( | ) |
Occurs when the token expires in 30 seconds.
renewToken
method to pass the new token to the SDK.
login
session expires, the user becomes offline and the SDK attempts to reconnect.
void io.agora.rtm.RtmClientListener.onPeersOnlineStatusChanged | ( | Map< String, Integer > | peersStatus | ) |
Occurs when the online status of the peers, to whom you subscribe, changes.
peersStatus |
An array of peers' online states. See
PeerOnlineState .
|