API Overview Document
The Agora RTM SDK provides a stable messaging mechanism for you to implement real-time
messaging scenarios.
This page lists the core APIs of the Agora RTM SDK. Unless otherwise specified, most
of the core APIs should only be called after the
loginByToken
method call succeeds and after you receive the
AgoraRtmLoginErrorOk
error code.
Following are the core functionalities that the Agora RTM SDK provides.
Login and logout
The connection state between the SDK and the Agora RTM system is a core concept for
you to understand before developing an RTM app. For more information, see:
Event |
Description |
connectionStateChanged
|
Occurs when the connection state between the SDK and the Agora RTM system
changes.
|
Sending a peer-to-peer message
Event |
Description |
messageReceived
|
Occurs when receiving a peer-to-peer message. |
Querying the online status of the specified users
Subscribing to or unsubscribing from the online status of specified users
User attribute operations
Channel attribute operations
Event for all channel members |
Description |
attributeUpdate
|
Occurs when the channel attributes are updated, and returns all attributes of
the channel.
|
Retrieving channel member count of specified channels
Joining or leaving a channel
Event |
Description |
memberJoined
|
Occurs when a remote user joins the channel. |
memberLeft
|
Occurs when a remote member leaves the channel. |
memberCount
|
Occurs when the number of the channel members changes, and returns the new
number.
|
Channel message
Event |
Description |
messageReceived
|
Occurs when the local user receives a channel message. |
Retrieving a member list of the channel
Call invitation management
- API calling sequence for canceling a sent call invitation:
- API calling sequence for accepting a received call invitation:
- API calling sequence for declining a received call invitation:
Renew the Token
Event |
Description |
rtmKitTokenDidExpire
|
Occurs when the RTM server detects that the RTM token has exceeded the specified
validity period.
|
Logfile settings and version Check
-
Logfile-related operations can be done after creating and initializing the
AgoraRtmKit instance and before
calling the
loginByToken
method.
-
getSDKVersion
is a static method. You can call it before creating and
initializing an AgoraRtmKit instance.
Method |
Description |
setLogFile
|
Specifies the default path to the SDK log file. |
setLogFileSize
|
Sets the size of a single log file. The SDK has two log files with the same
size.
|
setLogFilters
|
Sets the output log level of the SDK. |
getSDKVersion
|
Gets the version of the Agora RTM SDK. |
Customized method
Method |
Description |
setParameters
|
Provides the technical preview functionalities or special customizations by
configuring the SDK with JSON options.
|
Region settings
Status Codes
Connection states between the SDK and the Agora RTM system.
Status code |
Description |
AgoraRtmConnectionStateDisconnected |
1: The initial state. The SDK is disconnected from the Agora RTM system.
When the user calls the
loginByToken
method, the SDK starts to log in the Agora RTM system, triggers the
connectionStateChanged
callback, and switches to the
AgoraRtmConnectionStateConnecting state.
|
AgoraRtmConnectionStateConnecting |
2: The SDK is logging in the Agora RTM system.
Success: The SDK triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateConnected state.
Failure: The SDK triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateDisConnected state.
|
AgoraRtmConnectionStateConnected |
3: The SDK has logged in the Agora RTM system.
If the connection between the SDK and the Agora RTM system is interrupted
because of network issues, the SDK triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateReconnecting state.
If the login is banned by the server because, for example, another instance
logs in the Agora RTM system with the same user ID, the SDK triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateAborted state.
If the user calls the
logoutWithCompletion
method to log out of the Agora RTM system and receives
AgoraRtmLogoutErrorOk , the SDK triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateDisconnected state.
|
AgoraRtmConnectionStateReconnecting |
4: The connection state between the SDK and the Agora RTM system is interrupted
due to network issues, and the SDK keeps re-logging in the Agora RTM system.
If the SDK successfully re-logs in the Agora RTM system, it triggers the
connectionStateChanged
callback and switches to the
AgoraRtmConnectionStateConnected state. The SDK automatically
adds the user back to the channels he or she was in when the connection was
interrupted, and synchronizes the local user’s attributes with the
server.
If the SDK fails to re-log in the Agora RTM system, the SDK stays in the
AgoraRtmConnectionStateReconnecting state and keeps re-logging
in the system.
|
AgoraRtmConnectionStateAborted |
5: The SDK gives up logging in the Agora RTM system, mainly because another
instance has logged in the Agora RTM system with the same user ID.
You must call the
logoutWithCompletion
method before calling the
loginByToken
method to log in the Agora RTM system again.
|
Reasons for a connection state change.
Status code |
Description |
AgoraRtmConnectionChangeReasonLogin |
1: The SDK is logging in the Agora RTM system. |
AgoraRtmConnectionChangeReasonLoginSuccess |
2: The SDK has logged in the Agora RTM system. |
AgoraRtmConnectionChangeReasonLoginFailure |
3: The SDK fails to log in the Agora RTM system. |
AgoraRtmConnectionChangeReasonLoginTimeout |
4: The login has timed out for 10 seconds, and the SDK stops logging in.
|
AgoraRtmConnectionChangeReasonInterrupted |
5: The connection between the SDK and the Agora RTM system is interrupted for
more than four seconds.
|
AgoraRtmConnectionChangeReasonLogout |
6: The user has called the
logoutWithCompletion
method to log out of the Agora RTM system.
|
AgoraRtmConnectionChangeReasonBannedByServer |
7: Login is banned by the Agora RTM server. |
AgoraRtmConnectionChangeReasonRemoteLogin |
8: Another instance has logged in the Agora RTM system with the same user ID.
|
Message types.
Status code |
Description |
AgoraRtmMessageTypeUndefined |
0: Undefined message type. |
AgoraRtmMessageTypeText |
1: A text message. |
AgoraRtmMessageTypeRaw |
2: A raw message. |
Subscription types.
Status code |
Description |
AgoraRtmPeerSubscriptionOnlineStatus |
0: Takes out a subscription to the online status of specified users.
|
AgoraPeerOnlineState
The online states of a peer.
Status code |
Description |
AgoraRtmPeerOnlineStateOnline |
0: The peer is online. |
AgoraRtmPeerOnlineStateUnreachable |
1: The peer is temporarily unreachable (the server has not received a packet
from the SDK for more than 12 seconds).
|
AgoraRtmPeerOnlineStateOffline |
2: The peer is offline (the sdk has not logged in the Agora RTM system, or it
has logged out of the system, or the server has not received a packet from the
SDK for more than 30 seconds).
|
RETURNED TO THE CALLER. States of an outgoing call invitation.
Status code |
Description |
AgoraRtmLocalInvitationStateIdle |
0: RETURNED TO THE CALLER. The initial state of a call invitation (idle).
|
AgoraRtmLocalInvitationStateSentToRemote |
1: FOR INTERNAL USE ONLY. |
AgoraRtmLocalInvitationStateReceivedByRemote |
2: RETURNED TO THE CALLER. The call invitation is received by the callee.
|
AgoraRtmLocalInvitationStateAcceptedByRemote |
3: RETURNED TO THE CALLER. The call invitation is accepted by the callee.
|
AgoraRtmLocalInvitationStateRefusedByRemote |
4: RETURNED TO THE CALLER. The call invitation is declined by the callee.
|
AgoraRtmLocalInvitationStateCanceled |
5: RETURNED TO THE CALLER. You have canceled the call invitation.
|
AgoraRtmLocalInvitationStateFailure |
6: RETURNED TO THE CALLER. The life cycle of the outgoing call invitation
ends in failure.
|
RETURNED TO THE CALLEE. States of an incoming call invitation.
Status code |
Description |
AgoraRtmRemoteInvitationStateIdle |
0: RETURNED TO THE CALLEE. The initial state of a call invitation (idle).
|
AgoraRtmRemoteInvitationStateInvitationReceived |
1: RETURNED TO THE CALLEE. A call invitation from a remote caller is
received.
|
AgoraRtmRemoteInvitationStateAcceptSentToLocal |
2: FOR INTERNAL USE ONLY. |
AgoraRtmRemoteInvitationStateRefused |
3: RETURNED TO THE CALLEE. You have declined the call invitation.
|
AgoraRtmRemoteInvitationStateAccepted |
4: RETURNED TO THE CALLEE. You have accepted the call invitation.
|
AgoraRtmRemoteInvitationStateCanceled |
5: RETURNED TO THE CALLEE. The call invitation is canceled by the remote
caller.
|
AgoraRtmRemoteInvitationStateFailure |
6: RETURNED TO THE CALLEE. The life cycle of the incoming call invitation
ends in failure.
|
Log Filter types.
Status code |
Description |
AgoraRtmLogFilterOff |
0: Do not output any log information. |
AgoraRtmLogFilterInfo |
0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information.
|
AgoraRtmLogFilterWarn |
0x000e: Output CRITICAL, ERROR, and WARNING level log information.
|
AgoraRtmLogFilterError |
0x000c: Output CRITICAL and ERROR level log information. |
AgoraRtmLogFilterCritical |
0x0008: Output CRITICAL level log information. |
AgoraRtmLogFilterMask |
0x80f: RESERVED FOR FUTURE USE |
Error Codes
Error codes related to retrieving the channel member count of specified channels.
Error code |
Description |
AgoraRtmChannelMemberCountErrorOk |
0: The operation succeeds. |
AgoraRtmChannelMemberCountErrorFailure |
1: Unknown common failure. |
AgoraRtmChannelMemberCountErrorInvalidArgument |
2: One or several of your channel IDs is invalid. |
AgoraRtmChannelMemberCountErrorTooOften |
3: The method call frequency exceeds the limit of one query per second.
|
AgoraRtmChannelMemberCountErrorTimeout |
4: A timeout occurs during this operation. The current timeout is set as five
seconds.
|
AgoraRtmChannelMemberCountErrorExceedLimit |
5: The number of the channels that you query is greater than 32.
|
AgoraRtmChannelMemberCountErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmChannelMemberCountErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before this operation.
|
Error codes related to retrieving a channel member list.
Error code |
Description |
AgoraRtmGetMembersErrorOk |
0: The user retrieves a member list of the channel successfully.
|
AgoraRtmGetMembersErrorFailure |
1: The user fails to retrieve a member list of the channel. |
AgoraRtmGetMembersErrorRejected |
2: RESERVED FOR FUTURE USE |
AgoraRtmGetMembersErrorTimeout |
3: A timeout occurs when retreiving a member list of the channel. The current
timeout is set as five seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmGetMembersErrorTooOften |
4: The method call frequency exceeds the limit of five queries every two
seconds.
|
AgoraRtmGetMembersErrorNotInChannel |
5: The user is not in channel. |
AgoraRtmGetMembersErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmGetMembersErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before retrieving a member list.
|
Error codes for the call invitation methods.
Error code |
Description |
AgoraRtmInvitationApiCallErrorOk |
0: The method call succeeds. |
AgoraRtmInvitationApiCallErrorInvalidAugment |
1: The method call fails. Invalid argument. |
AgoraRtmInvitationApiCallErrorNotStarted |
2: The method call fails. The call invitation has not started.
|
AgoraRtmInvitationApiCallErrorAlreadyEnd |
3: The method call fails. The call invitation has ended. |
AgoraRtmInvitationApiCallErrorAlreadyAccept |
4: The method call fails. The call invitation is already accepted.
|
AgoraRtmInvitationApiCallErrorAlreadySent |
5: The method call fails. The call invitation is already sent.
|
Error codes related to joining a channel.
Error code |
Description |
AgoraRtmJoinChannelErrorOk |
0: The user joins the channel successfully. |
AgoraRtmJoinChannelErrorFailure |
1: The user fails to join the channel. |
AgoraRtmJoinChannelErrorRejected |
2: RESERVED FOR FUTURE USE |
AgoraRtmJoinChannelErrorInvalidArgument |
3: The user fails to join the channel because the argument is invalid.
|
AgoraRtmJoinChannelErrorTimeout |
4: A timeout occurs when joining the channel. The current timeout is set as five
seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmJoinChannelErrorExceedLimit |
5: The number of the RTM channels you are in exceeds the limit of 20.
|
AgoraRtmJoinChannelErrorAlreadyJoined |
6: The user is joining or has joined the channel. |
AgoraRtmJoinChannelErrorTooOften |
7: The method call frequency exceeds the limit of 50 queries every three
seconds.
|
AgoraRtmJoinSameChannelErrorTooOften |
8: The method call frequency exceeds the limit of 2 queries per 5 seconds for
the same channel.
|
AgoraRtmJoinChannelErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmJoinChannelErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before joining the channel.
|
Error codes related to leaving a channel.
Error code |
Description |
AgoraRtmLeaveChannelErrorOk |
0: The user leaves the channel successfully. |
AgoraRtmLeaveChannelErrorFailure |
1: The user fails to leave the channel. |
AgoraRtmLeaveChannelErrorRejected |
2: RESERVED FOR FUTURE USE |
AgoraRtmLeaveChannelErrorNotInChannel |
3: The user is not in the channel. |
AgoraRtmLeaveChannelErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmLeaveChannelErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before leaving the channel.
|
Error codes related to login.
Error code |
Description |
AgoraRtmLoginErrorOk |
0: Login succeeds. No error occurs. |
AgoraRtmLoginErrorUnknown |
1: Login fails for reasons unknown. |
AgoraRtmLoginErrorRejected |
2: Login is rejected by the server. |
AgoraRtmLoginErrorInvalidArgument |
3: Invalid login arguments. |
AgoraRtmLoginErrorInvalidAppId |
4: The App ID is invalid. |
AgoraRtmLoginErrorInvalidToken |
5: The token is invalid. |
AgoraRtmLoginErrorTokenExpired |
6: The token has expired, and hence login is rejected. |
AgoraRtmLoginErrorNotAuthorized |
7: Unauthorized login. |
AgoraRtmLoginErrorAlreadyLogin |
8: The user has already logged in or is logging in the Agora RTM system, or the
user has not called the
logoutWithCompletion
method to leave the AgoraRtmConnectionStateAborted state.
|
AgoraRtmLoginErrorTimeout |
9: The login times out. The current timeout is set as 12 seconds.
|
AgoraRtmLoginErrorLoginTooOften |
10: The call frequency of the
loginByToken
method exceeds the limit of two queries per second.
|
AgoraRtmLoginErrorLoginNotInitialized |
101: The SDK is not initialized. |
Error codes related to logout.
Error code |
Description |
AgoraRtmLogoutErrorOk |
0: Logout succeeds. No error occurs. |
AgoraRtmLogoutErrorRejected |
1: RESERVED FOR FUTURE USE |
AgoraRtmLogoutErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmLogoutErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before the user logs out of the Agora RTM system.
|
Error codes related to subscribing to or unsubscribing from the status of specified
peers.
Error code |
Description |
AgoraRtmPeerSubscriptionStatusErrorOk |
0: The method call succeeds, or the operation succeeds. |
AgoraRtmPeerSubscriptionStatusErrorFailure |
1: Common failure. The user fails to subscribe to or unsubscribe from the status
of the specified peers.
|
AgoraRtmPeerSubscriptionStatusErrorInvalidArgument
|
2: The method call fails. The argument is invalid. |
AgoraRtmPeerSubscriptionStatusErrorRejected |
3: RESERVED FOR FUTURE USE |
AgoraRtmPeerSubscriptionStatusErrorTimeout |
4: The SDK fails to receive a response from the server in 10 seconds. The
current timeout is set as 10 seconds. Possible reasons: The user is in the \ref
agora::rtm::CONNECTION_STATE_ABORTED “CONNECTION_STATE_ABORTED” or
\ref agora::rtm::CONNECTION_STATE_RECONNECTING
“CONNECTION_STATE_RECONNECTING” state.
|
AgoraRtmPeerSubscriptionStatusErrorTooOften |
5: The method call frequency exceeds the limit of 10 subscribes every five
seconds.
|
PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW |
6: The number of peers, to whom you subscribe, exceeds the limit of 512.
|
AgoraRtmPeerSubscriptionStatusErrorNotInitialized
|
101: The SDK is not initialized. |
AgoraRtmPeerSubscriptionStatusErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before this operation.
|
Error codes related to the attrubute operations.
Error code |
Description |
AgoraRtmAttributeOperationErrorOk |
0: The attribute operation succeeds. |
AgoraRtmAttributeOperationErrorNotReady |
1: DEPRECATED |
AgoraRtmAttributeOperationErrorFailure |
2: The attribute operation fails. |
AgoraRtmAttributeOperationErrorInvalidArgument |
3: The argument you put for this attribute operation is invalid.
|
AgoraRtmAttributeOperationErrorSizeOverflow |
4: The attribute size exceeds the limit.
For user attribute operations: The user’s overall attribute size would
exceed the limit of 16 KB, one of the user’s attributes would exceeds
8 KB in size, or the number of this user’s attributes would exceed 32
after this attribute operation.
For channel attribute operations: The channel’s overall attribute size
would exceed the limit of 32 KB, one of the channel attributes would exceed
8 KB in size, or the number of this channel’s attributes would exceed
32 after this attribute operation.
|
AgoraRtmAttributeOperationErrorTooOften |
5: The method call frequency exceeds the limit.
For
setLocalUserAttributes,
addOrUpdateLocalUserAttributes,
deleteLocalUserAttributesByKeys
and
clearLocalUserAttributes
taken together: the limit is 10 queries every five seconds.
For
getUserAttributes
and
getUserAttributesByKeys
taken together, the limit is 40 queries every five seconds.
For
setChannelAttributes,
addOrUpdateChannelAttributes,
deleteChannelAttributesByKeys
and
clearChannelAttributes
taken together: the limit is 10 queries every five seconds.
For
getChannelAllAttributes
and
getChannelAttributesByKeys
taken together, the limit is 10 queries every five seconds.
|
AgoraRtmAttributeOperationErrorUserNotFound |
6: The specified user is not found, either because the user is offline or
because the user does not exist.
|
AgoraRtmAttributeOperationErrorTimeout |
7: A timeout occurs in the attribute-related operation. The current timeout is
set as five seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmAttributeOperationErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmAttributeOperationErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before the attribute operation.
|
Error codes related to getting a list of the peers by suscription option type.
Error code |
Description |
AgoraRtmQueryPeersBySubscriptionOptionErrorOk |
0: The method call succeeds, or the operation succeeds. |
AgoraRtmQueryPeersBySubscriptionOptionErrorFailure
|
1: Common failure. The user fails to query peers by subscription option type.
|
AgoraRtmQueryPeersBySubscriptionOptionErrorTimeout
|
2: The SDK fails to receive a response from the server in 5 seconds. The current
timeout is set as 5 seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmQueryPeersBySubscriptionOptionErrorTooOften
|
3: The method call frequency exceeds the limit of 10 subscribes every five
seconds.
|
AgoraRtmQueryPeersBySubscriptionOptionErrorNotInitialized
|
101: The SDK is not initialized. |
AgoraRtmQueryPeersBySubscriptionOptionErrorNotLoggedIn
|
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before this operation.
|
Error codes related to querying the online status of the specified peers.
Error code |
Description |
AgoraRtmQueryPeersOnlineErrorOk |
0: The method call succeeds. |
AgoraRtmQueryPeersOnlineErrorFailure |
1: The method call fails. |
AgoraRtmQueryPeersOnlineErrorInvalidArgument |
2: The method call fails. The argument is invalid. |
AgoraRtmQueryPeersOnlineErrorRejected |
3: RESERVED FOR FUTURE USE |
AgoraRtmQueryPeersOnlineErrorTimeout |
4: The SDK has not received a response from the server for 10 seconds. The
current timeout is set as 10 seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmQueryPeersOnlineErrorTooOften |
5: The method call frequency of this method exceeds the limit of 10 queries
every five seconds.
|
AgoraRtmQueryPeersOnlineErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmQueryPeersOnlineErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before querying the online status.
|
RETURNED TO THE CALLER. Error codes of an outgoing call invitation.
Error code |
Description |
AgoraRtmLocalInvitationErrorOk |
0: RETURNED TO THE CALLER. The outgoing call invitation succeeds.
|
AgoraRtmLocalInvitationErrorRemoteOffline |
1: RETURNED TO THE CALLER. The callee is offline.
The SDK:
-
Keeps resending the call invitation to the callee, if he or she is offline.
-
Returns this error code, if he or she is still offline 30 seconds since the
call invitation is sent.
|
AgoraRtmLocalInvitationErrorRemoteNoResponse |
2: RETURNED TO THE CALLER. The callee is online but has not ACKed to the
call invitation 30 seconds since it is sent.
|
AgoraRtmLocalInvitationErrorExpire |
3: RETURNED TO THE CALLER. SAVED FOR FUTURE USE. The call invitation
expires 60 seconds since it is sent, if the callee ACKs to the call invitation
but neither the caller or callee takes any further action (cancel, accpet, or
decline it).
|
AgoraRtmLocalInvitationErrorNotLoggedIn |
4: RETURNED TO THE CALLER. The caller is not logged in.
|
RETURNED TO THE CALLEE. Error codes of an incoming call invitation.
Error code |
Description |
AgoraRtmRemoteInvitationErrorOk |
0: RETURNED TO THE CALLEE. The incoming call invitation succeeds.
|
AgoraRtmRemoteInvitationErrorLocalOffline |
1: RETURNED TO THE CALLEE. The call invitation received by the callee
fails: the callee is not online.
|
AgoraRtmRemoteInvitationErrorAcceptFailure |
2: RETURNED TO THE CALLEE. The call invitation received by callee fails:
the acceptance of the call invitation fails.
|
AgoraRtmRemoteInvitationErrorExpire |
3: RETURNED TO THE CALLEE. The call invitation received by the callee
fails: the call invitation expires 60 seconds since it is sent, if the callee
ACKs to the call invitation but neither the caller or callee takes any further
action (cancel, accpet, or decline it).
|
Error codes related to renewing the token.
Error code |
Description |
AgoraRtmRenewTokenErrorOk |
0: The token-renewing operation succeeds. |
AgoraRtmRenewTokenErrorFailure |
1: Common unknown failure. |
AgoraRtmRenewTokenErrorInvalidArgument |
2: The method call fails. The argument is invalid. |
AgoraRtmRenewTokenErrorRejected |
3: RESERVED FOR FUTURE USE |
AgoraRtmRenewTokenErrorTooOften |
4: The method call frequency of exceeds the limit of two queries per second.
|
AgoraRtmRenewTokenErrorTokenExpired |
5: The token has expired. |
AgoraRtmRenewTokenErrorInvalidToken |
6: The token is invalid. |
AgoraRtmRenewTokenErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmRenewTokenErrorNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before renewing the token.
|
Error codes related to sending a channel message.
Error code |
Description |
AgoraRtmSendChannelMessageErrorOk |
0: The server receives the channel message. |
AgoraRtmSendChannelMessageErrorFailure |
1: The user fails to send the channel message state. |
AgoraRtmSendChannelMessageErrorTimeout |
2: The SDK does not receive a response from the server in 10 seconds. The
current timeout is set as 10 seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmSendChannelMessageTooOften |
3: The method call frequency exceeds the limit of 180 calls every three seconds
(channel and peer messages taken together).
|
AgoraRtmSendChannelMessageInvalidMessage |
4: The message is null or exceeds 32 KB in length. |
AgoraRtmSendChannelMessageErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmSendChannelMessageNotLoggedIn |
102: The user does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before sending out a channel message.
|
Error codes related to sending a peer-to-peer message.
Error code |
Description |
AgoraRtmSendPeerMessageErrorOk |
0: The specified user receives the peer-to-peer message. |
AgoraRtmSendPeerMessageErrorFailure |
1: The user fails to send the peer-to-peer message. |
AgoraRtmSendPeerMessageErrorTimeout |
2: A timeout occurs when sending the peer-to-peer message. The current timeout
is set as 10 seconds. Possible reasons: The user is in the
AgoraRtmConnectionStateAborted or
AgoraRtmConnectionStateReconnecting state.
|
AgoraRtmSendPeerMessageErrorPeerUnreachable |
3: The user is offline and has not received the peer-to-peer message.
|
AgoraRtmSendPeerMessageErrorCachedByServer |
4: The specified user is offline and does not receive the peer-to-peer message,
but the server has cached the message and will send the message to the specified
user when he/she is back online.
|
AgoraRtmSendPeerMessageErrorTooOften |
5: The method call frequency exceeds the limit of 180 calls every three seconds
(channel and peer messages taken together).
|
AgoraRtmSendPeerMessageErrorInvalidUserId |
6: The user ID is invalid. |
AgoraRtmSendPeerMessageErrorInvalidMessage |
7: The message is null or exceeds 32 KB in length. |
AgoraRtmSendPeerMessageErrorNotInitialized |
101: The SDK is not initialized. |
AgoraRtmSendPeerMessageErrorNotLoggedIn |
102: The sender does not call the
loginByToken
method, or the method call of
loginByToken
does not succeed before sending the peer-to-peer message.
|