AgoraConnectionChangedReason Constants Reference

Declared in AgoraEnumerates.h

AgoraConnectionChangedReason

Reasons for the connection state change.

Constants

AgoraConnectionChangedConnecting

0: The SDK is connecting to Agora’s edge server.

Declared In AgoraEnumerates.h.

AgoraConnectionChangedJoinSuccess

1: The SDK has joined the channel successfully.

Declared In AgoraEnumerates.h.

AgoraConnectionChangedInterrupted

2: The connection between the SDK and Agora’s edge server is interrupted.

Declared In AgoraEnumerates.h.

AgoraConnectionChangedBannedByServer

3: The connection is banned by the server. This occurs when the server calls the Banning user privileges API_channel_management_restfulapi?platform=RESTful#banning-user-privileges to kick the user out of the channel. You can display a pop-up box in the application that says: “The user has been banned from this channel.”

Declared In AgoraEnumerates.h.

AgoraConnectionChangedJoinFailed

4: The SDK fails to join the channel. This occurs when the SDK fails to rejoin the channel within 20 minutes after receiving the connectionChangedToState(AgoraConnectionStateReconnecting, AgoraConnectionChangedInterrupted) callback and stops trying. You can display a pop-up box in the application that says: “Failed to join the channel due to network issues. Please try to rejoin the channel after switching to a different network.”

Declared In AgoraEnumerates.h.

AgoraConnectionChangedLeaveChannel

5: The SDK has left the channel.

Declared In AgoraEnumerates.h.

AgoraConnectionChangedInvalidAppId

6: The specified App ID is invalid. Check whether the App ID used by the user is the same as the App ID obtained from the Agora Console, and then try to rejoin the channel with a valid App ID.

Declared In AgoraEnumerates.h.

AgoraConnectionChangedInvalidChannelName

7: The specified channel name is invalid. The channel name cannot be empty nor longer than 64 bytes in length. For supported characters, see the channelName parameter in joinChannelByToken. You can display a pop-up box in the application that says: “The channel name is invalid. Please try to rejoin the channel with a valid channel name.”

Declared In AgoraEnumerates.h.

AgoraConnectionChangedInvalidToken

8: The token is invalid, probably due to the following reasons:

  • The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel.
  • The uid that you specify in the joinChannelByToken method is different from the uid that you pass for generating the token. Check whether the token used by the user is the same as the token generated at your app server, and then try to rejoin the channel with a valid token.

    Declared In AgoraEnumerates.h.

  • AgoraConnectionChangedTokenExpired

    9: The token has expired. The user using the expired token is forced to leave the channel. The app client needs to request a new token from the app server and then try to rejoin the channel with the new token.

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedRejectedByServer

    10: The user is banned by the server. This error usually occurs in the following situations:

  • When the user is already in the channel, and still calls the method to join the channel, for example, joinChannelByToken.
  • When the user tries to join a channel during a call test (startEchoTestWithInterval). Once you call startEchoTest, you need to call stopEchoTest before joining a channel.
  • Declared In AgoraEnumerates.h.

    AgoraConnectionChangedSettingProxyServer

    11: The SDK tries to reconnect after setting a proxy server.

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedRenewToken

    12: The token renews.

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedClientIpAddressChanged

    13: Due to a change of the network type, IP address, or network port, the client IP address has changed, and the SDK tries to reconnect. If this state occurs multiple times, you can display a pop-up box in the application that says: “The network connection is not stable. Please switch to another network.”

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedKeepAliveTimeout

    14: Timeout for the keep-alive of the connection between the SDK and Agora’s edge server. The connection state changes to AgoraConnectionStateReconnecting(4).

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedSameUidLogin

    19: Join the same channel from different devices using the same user ID.

    Available in v3.7.0

    Declared In AgoraEnumerates.h.

    AgoraConnectionChangedTooManyBroadcasters

    20: The number of hosts in the channel is already at the upper limit.

    Available in v3.7.0

    Declared In AgoraEnumerates.h.

    Declared In

    AgoraEnumerates.h