AgoraConnectionChangedReason Constants Reference

Declared in AgoraEnumerates.h


Reasons for the connection state change.



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

Declared In AgoraEnumerates.h.


1: The SDK has joined the channel successfully.

Declared In AgoraEnumerates.h.


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

Declared In AgoraEnumerates.h.


3: The user is banned by the server. This error occurs when the user is kicked out the channel from the server.

Declared In AgoraEnumerates.h.


4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel.

Declared In AgoraEnumerates.h.


5: The SDK has left the channel.

Declared In AgoraEnumerates.h.


6: The specified App ID is invalid. Try to rejoin the channel with a valid App ID.

Declared In AgoraEnumerates.h.


7: The specified channel name is invalid. Try to rejoin the channel with a valid channel name.

Declared In AgoraEnumerates.h.


8: The generated 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.

    Declared In AgoraEnumerates.h.

  • AgoraConnectionChangedTokenExpired

    9: The token has expired. Generate a new token from your server.

    Declared In AgoraEnumerates.h.


    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.


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

    Declared In AgoraEnumerates.h.


    12: The token renews.

    Declared In AgoraEnumerates.h.


    13: The client IP address has changed, probably due to a change of the network type, IP address, or network port.

    Declared In AgoraEnumerates.h.


    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.


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

    Available in v3.7.0

    Declared In AgoraEnumerates.h.


    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