Important: This is documentation for the legacy version of the Vivox Unity SDK. This documentation will be removed after July 2025. Refer to the v16 documentation for the new version of the SDK.

Join a channel

To join a channel, create an IChannelSession by using a game-selected identifier for the channel and channel type, and then call its BeginConnect() method.

Note: Before joining a Vivox voice channel on desktop or mobile, developers must check the permissions for the capture device at runtime.

Joining a channel requires an access token.For more information, refer to the Access Token Developer Guide.

To enable development and prototyping token generation, manually add or automatically pull your Vivox Token key into your project.

Note: Don't use development and prototyping tokens in a production environment.

  1. Open your Unity project.

  2. Select Edit > Project Settings. Select the Vivox tab, and then perform either of the following actions:

    • Manually enter the Vivox credentials.

      These are found on the Unity Cloud Dashboard, in the Vivox section, on your project’s Credentials page.

    • For a project that is already associated with the Unity Cloud Dashboard, update Environment to Automatic.

      This automatically pulls Vivox credentials into your project.

You can then generate development and prototyping keys by using IChannelSession.GetConnectToken() without any parameters for the default TokenExpiration (60 seconds), or with a custom TimeSpan passed in for the TokenExpiration.

When joining a channel, the game can choose whether to join with audio capability, which enables the player to participate in group audio, and whether to join text capability, which enables the player to participate in group text. This is set with the connectAudio and connectText arguments to BeginConnect(), respectively. You can add or drop these capabilities without having to leave or rejoin the channel by calling IChannelSession.BeginSetAudioConnected() or IChannelSession.BeginSetTextConnected().

You can also set the argument switchTransmission to true to automatically switch audio transmission into only the new channel after connection. This overrides and changes the TransmissionMode set in ILoginSession. You can manage channel transmission at any time by using ILoginSession.SetTransmissionMode().

Note: A user can join a maximum of 10 non-positional channels at a time. Attempts to join a channel beyond that limit fail with a VxXmppServerErrorServiceUnavailable (20502) error.

Note: Channels have a maximum occupancy of 200 participants. Attempts to join a channel that has reached 200 participants will fail with a VxXmppServerErrorServiceUnavailable (20502) error.