Signaling (previously RTM) SDK v1.5.0 API Reference for Windows (C++)
Public Member Functions | List of all members
agora::rtm::IRtmServiceEventHandler Class Reference

#include <IAgoraRtmService.h>

Public Member Functions

virtual  ~IRtmServiceEventHandler ()
 
virtual void  onLoginSuccess ()
 
virtual void  onLoginFailure (LOGIN_ERR_CODE errorCode)
 
virtual void  onRenewTokenResult (const char *token, RENEW_TOKEN_ERR_CODE errorCode)
 
virtual void  onTokenExpired ()
 
virtual void  onTokenPrivilegeWillExpire ()
 
virtual void  onLogout (LOGOUT_ERR_CODE errorCode)
 
virtual void  onConnectionStateChanged (CONNECTION_STATE state, CONNECTION_CHANGE_REASON reason)
 
virtual void  onSendMessageResult (long long messageId, PEER_MESSAGE_ERR_CODE errorCode)
 
virtual void  onMessageReceivedFromPeer (const char *peerId, const IMessage *message)
 
virtual void  onImageMessageReceivedFromPeer (const char *peerId, const IImageMessage *message)
 
virtual void  onFileMessageReceivedFromPeer (const char *peerId, const IFileMessage *message)
 
virtual void  onMediaUploadingProgress (long long requestId, const MediaOperationProgress &progress)
 
virtual void  onMediaDownloadingProgress (long long requestId, const MediaOperationProgress &progress)
 
virtual void  onFileMediaUploadResult (long long requestId, IFileMessage *fileMessage, UPLOAD_MEDIA_ERR_CODE code)
 
virtual void  onImageMediaUploadResult (long long requestId, IImageMessage *imageMessage, UPLOAD_MEDIA_ERR_CODE code)
 
virtual void  onMediaDownloadToFileResult (long long requestId, DOWNLOAD_MEDIA_ERR_CODE code)
 
virtual void  onMediaDownloadToMemoryResult (long long requestId, const char *memory, long long length, DOWNLOAD_MEDIA_ERR_CODE code)
 
virtual void  onMediaCancelResult (long long requestId, CANCEL_MEDIA_ERR_CODE code)
 
virtual void  onQueryPeersOnlineStatusResult (long long requestId, const PeerOnlineStatus *peersStatus, int peerCount, QUERY_PEERS_ONLINE_STATUS_ERR errorCode)
 
virtual void  onSubscriptionRequestResult (long long requestId, PEER_SUBSCRIPTION_STATUS_ERR errorCode)
 
virtual void  onQueryPeersBySubscriptionOptionResult (long long requestId, const char *peerIds[], int peerCount, QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR errorCode)
 
virtual void  onPeersOnlineStatusChanged (const PeerOnlineStatus peersStatus[], int peerCount)
 
virtual void  onSetLocalUserAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onAddOrUpdateLocalUserAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onDeleteLocalUserAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onClearLocalUserAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onGetUserAttributesResult (long long requestId, const char *userId, const RtmAttribute *attributes, int numberOfAttributes, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onSetChannelAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onAddOrUpdateChannelAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onDeleteChannelAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onClearChannelAttributesResult (long long requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onGetChannelAttributesResult (long long requestId, const IRtmChannelAttribute *attributes[], int numberOfAttributes, ATTRIBUTE_OPERATION_ERR errorCode)
 
virtual void  onGetChannelMemberCountResult (long long requestId, const ChannelMemberCount *channelMemberCounts, int channelCount, GET_CHANNEL_MEMBER_COUNT_ERR_CODE errorCode)
 

Constructor & Destructor Documentation

◆ ~IRtmServiceEventHandler()

virtual agora::rtm::IRtmServiceEventHandler::~IRtmServiceEventHandler ( )
inlinevirtual

Member Function Documentation

◆ onLoginSuccess()

virtual void agora::rtm::IRtmServiceEventHandler::onLoginSuccess ( )
inlinevirtual

Occurs when a user logs in the Agora RTM system.

The local user receives this callback when the login method call succeeds.

◆ onLoginFailure()

virtual void agora::rtm::IRtmServiceEventHandler::onLoginFailure ( LOGIN_ERR_CODE  errorCode )
inlinevirtual

Occurs when a user fails to log in the Agora RTM system.

The local user receives this callback when the login method call fails. See LOGIN_ERR_CODE for the error codes.

◆ onRenewTokenResult()

virtual void agora::rtm::IRtmServiceEventHandler::onRenewTokenResult ( const char *  token,
RENEW_TOKEN_ERR_CODE  errorCode 
)
inlinevirtual

Reports the result of the renewToken method call.

Parameters
token Your new token.
errorCode The error code. See RENEW_TOKEN_ERR_CODE.

◆ onTokenExpired()

virtual void agora::rtm::IRtmServiceEventHandler::onTokenExpired ( )
inlinevirtual

Occurs when the RTM server detects that the RTM token has exceeded the specified validity period.

◆ onTokenPrivilegeWillExpire()

virtual void agora::rtm::IRtmServiceEventHandler::onTokenPrivilegeWillExpire ( )
inlinevirtual

Occurs when the token expires in 30 seconds.

  • Upon receiving this callback, generate a new token on the server and call the renewToken method to pass the new token to the SDK.
  • If the token used in the login method expires, the user becomes offline and the SDK attempts to reconnect.

◆ onLogout()

virtual void agora::rtm::IRtmServiceEventHandler::onLogout ( LOGOUT_ERR_CODE  errorCode )
inlinevirtual

Occurs when a user logs out of the Agora RTM system.

The local user receives this callback when the SDK calls the logout method. See LOGOUT_ERR_CODE for the error codes.

◆ onConnectionStateChanged()

virtual void agora::rtm::IRtmServiceEventHandler::onConnectionStateChanged ( CONNECTION_STATE  state,
CONNECTION_CHANGE_REASON  reason 
)
inlinevirtual

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

Parameters
state The new connection state. See CONNECTION_STATE.
reason The reason for the connection state change. See CONNECTION_CHANGE_REASON.

◆ onSendMessageResult()

virtual void agora::rtm::IRtmServiceEventHandler::onSendMessageResult ( long long  messageId,
PEER_MESSAGE_ERR_CODE  errorCode 
)
inlinevirtual

Reports the result of the sendMessageToPeer method call.

Parameters
messageId The ID of the sent message.
errorCode The peer-to-peer message state. See PEER_MESSAGE_ERR_CODE.

◆ onMessageReceivedFromPeer()

virtual void agora::rtm::IRtmServiceEventHandler::onMessageReceivedFromPeer ( const char *  peerId,
const IMessage message 
)
inlinevirtual

Occurs when receiving a peer-to-peer message.

Parameters
peerId The ID of the message sender.
message The received peer-to-peer message. See IMessage.

◆ onImageMessageReceivedFromPeer()

virtual void agora::rtm::IRtmServiceEventHandler::onImageMessageReceivedFromPeer ( const char *  peerId,
const IImageMessage message 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when receiving a peer-to-peer image message.

Parameters
peerId The ID of the message sender.
message The received peer-to-peer image message. See IImageMessage.

◆ onFileMessageReceivedFromPeer()

virtual void agora::rtm::IRtmServiceEventHandler::onFileMessageReceivedFromPeer ( const char *  peerId,
const IFileMessage message 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when receiving a peer-to-peer file message.

Parameters
peerId The ID of the message sender.
message The received peer-to-peer file message. See IFileMessage.

◆ onMediaUploadingProgress()

virtual void agora::rtm::IRtmServiceEventHandler::onMediaUploadingProgress ( long long  requestId,
const MediaOperationProgress progress 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Reports the progress of an ongoing upload task.

Note
  • If the upload task is ongoing, the SDK returns this callback once every second.
  • If the upload task comes to a halt, the SDK stops returning this callback until the task is going again.
Parameters
requestId The unique ID of the upload request.
progress The progress of the ongoing upload task. See MediaOperationProgress.

◆ onMediaDownloadingProgress()

virtual void agora::rtm::IRtmServiceEventHandler::onMediaDownloadingProgress ( long long  requestId,
const MediaOperationProgress progress 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Reports the progress of an ongoing download task.

Note
  • If the download task is ongoing, the SDK returns this callback once every second.
  • If the download task comes to a halt, the SDK stops returning this callback until the task is going again.
Parameters
requestId The unique ID of the download request.
progress The progress of the ongoing download task. See MediaOperationProgress.

◆ onFileMediaUploadResult()

virtual void agora::rtm::IRtmServiceEventHandler::onFileMediaUploadResult ( long long  requestId,
IFileMessage fileMessage,
UPLOAD_MEDIA_ERR_CODE  code 
)
inlinevirtual

Reports the result of the createFileMessageByUploading method call.

Parameters
requestId The unique ID of the upload request.
fileMessage An IFileMessage instance.
code Error codes. See UPLOAD_MEDIA_ERR_CODE.

◆ onImageMediaUploadResult()

virtual void agora::rtm::IRtmServiceEventHandler::onImageMediaUploadResult ( long long  requestId,
IImageMessage imageMessage,
UPLOAD_MEDIA_ERR_CODE  code 
)
inlinevirtual

Reports the result of the createImageMessageByUploading method call.

Parameters
requestId The unique ID of the upload request.
imageMessage An IImageMessage instance.
code Error codes. See UPLOAD_MEDIA_ERR_CODE.

◆ onMediaDownloadToFileResult()

virtual void agora::rtm::IRtmServiceEventHandler::onMediaDownloadToFileResult ( long long  requestId,
DOWNLOAD_MEDIA_ERR_CODE  code 
)
inlinevirtual

Reports the result of the downloadMediaToFile method call.

Parameters
requestId The unique ID of the download request.
code Error codes. See DOWNLOAD_MEDIA_ERR_CODE.

◆ onMediaDownloadToMemoryResult()

virtual void agora::rtm::IRtmServiceEventHandler::onMediaDownloadToMemoryResult ( long long  requestId,
const char *  memory,
long long  length,
DOWNLOAD_MEDIA_ERR_CODE  code 
)
inlinevirtual

Reports the result of the downloadMediaToMemory method call.

Note
The SDK releases the downloaded file or image immediately after returning this callback.
Parameters
requestId The unique ID of the download request.
memory The memory address where the downloaded file or image is stored.
length The size of the downloaded file or image.
code Error codes. See DOWNLOAD_MEDIA_ERR_CODE.

◆ onMediaCancelResult()

virtual void agora::rtm::IRtmServiceEventHandler::onMediaCancelResult ( long long  requestId,
CANCEL_MEDIA_ERR_CODE  code 
)
inlinevirtual

Reports the result of the cancelMediaDownload or cancelMediaUpload method call.

Parameters
requestId The unique ID of the cancel request.
code Error codes. See CANCEL_MEDIA_ERR_CODE.

◆ onQueryPeersOnlineStatusResult()

virtual void agora::rtm::IRtmServiceEventHandler::onQueryPeersOnlineStatusResult ( long long  requestId,
const PeerOnlineStatus peersStatus,
int  peerCount,
QUERY_PEERS_ONLINE_STATUS_ERR  errorCode 
)
inlinevirtual

Reports the result of the queryPeersOnlineStatus method call.

Parameters
requestId The unique ID of this request.
peersStatus The online status of the peer. See PeerOnlineStatus.
peerCount The number of the queried peers.
errorCode Error Codes. See QUERY_PEERS_ONLINE_STATUS_ERR.

◆ onSubscriptionRequestResult()

virtual void agora::rtm::IRtmServiceEventHandler::onSubscriptionRequestResult ( long long  requestId,
PEER_SUBSCRIPTION_STATUS_ERR  errorCode 
)
inlinevirtual

Returns the result of the subscribePeersOnlineStatus or unsubscribePeersOnlineStatus method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See PEER_SUBSCRIPTION_STATUS_ERR.

◆ onQueryPeersBySubscriptionOptionResult()

virtual void agora::rtm::IRtmServiceEventHandler::onQueryPeersBySubscriptionOptionResult ( long long  requestId,
const char *  peerIds[],
int  peerCount,
QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR  errorCode 
)
inlinevirtual

Returns the result of the queryPeersBySubscriptionOption method call.

Parameters
requestId The unique ID of this request.
peerIds A user ID array of the specified users, to whom you subscribe.
peerCount Count of the peers.
errorCode Error Codes. See QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR.

◆ onPeersOnlineStatusChanged()

virtual void agora::rtm::IRtmServiceEventHandler::onPeersOnlineStatusChanged ( const PeerOnlineStatus  peersStatus[],
int  peerCount 
)
inlinevirtual

Occurs when the online status of the peers, to whom you subscribe, changes.

  • When the subscription to the online status of specified peers succeeds, the SDK returns this callback to report the online status of peers, to whom you subscribe.
  • When the online status of the peers, to whom you subscribe, changes, the SDK returns this callback to report whose online status has changed.
  • If the online status of the peers, to whom you subscribe, changes when the SDK is reconnecting to the server, the SDK returns this callback to report whose online status has changed when successfully reconnecting to the server.
Parameters
peersStatus An array of peers' online states. See PeerOnlineStatus.
peerCount Count of the peers, whose online status changes.

◆ onSetLocalUserAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onSetLocalUserAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the setLocalUserAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onAddOrUpdateLocalUserAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onAddOrUpdateLocalUserAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the addOrUpdateLocalUserAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onDeleteLocalUserAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onDeleteLocalUserAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the deleteLocalUserAttributesByKeys method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onClearLocalUserAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onClearLocalUserAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the clearLocalUserAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onGetUserAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onGetUserAttributesResult ( long long  requestId,
const char *  userId,
const RtmAttribute attributes,
int  numberOfAttributes,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the getUserAttributes or getUserAttributesByKeys method call.

Parameters
requestId The unique ID of this request.
userId The user ID of the specified user.
attributes An array of the returned attributes. See RtmAttribute.
numberOfAttributes The total number of the user's attributes
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onSetChannelAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onSetChannelAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the setChannelAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onAddOrUpdateChannelAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onAddOrUpdateChannelAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the addOrUpdateChannelAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onDeleteChannelAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onDeleteChannelAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the deleteChannelAttributesByKeys method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onClearChannelAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onClearChannelAttributesResult ( long long  requestId,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the clearChannelAttributes method call.

Parameters
requestId The unique ID of this request.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onGetChannelAttributesResult()

virtual void agora::rtm::IRtmServiceEventHandler::onGetChannelAttributesResult ( long long  requestId,
const IRtmChannelAttribute attributes[],
int  numberOfAttributes,
ATTRIBUTE_OPERATION_ERR  errorCode 
)
inlinevirtual

Reports the result of the getChannelAttributes or getChannelAttributesByKeys method call.

Parameters
requestId The unique ID of this request.
attributes An array of the returned channel attributes.
numberOfAttributes The total number of the attributes.
errorCode Error Codes. See ATTRIBUTE_OPERATION_ERR.

◆ onGetChannelMemberCountResult()

virtual void agora::rtm::IRtmServiceEventHandler::onGetChannelMemberCountResult ( long long  requestId,
const ChannelMemberCount channelMemberCounts,
int  channelCount,
GET_CHANNEL_MEMBER_COUNT_ERR_CODE  errorCode 
)
inlinevirtual

Reports the result of the getChannelMemberCount method call.

Parameters
requestId The unique ID of this request.
channelMemberCounts An array of the channel member counts.
channelCount The total number of the channels.
errorCode Error Codes. See GET_CHANNEL_MEMBER_COUNT_ERR_CODE.