Documentation

Support

Vivox Unity SDK

Vivox Unity SDK

Sign in with the Authentication package

Sign players in to Vivox using the Unity Authentication Package.
Read time 1 minuteLast updated 2 days ago

Prerequisite: Configure the Unity Package Manager Vivox package. The easiest way to manage Vivox sign-ins is with the Unity Authentication package. To use the Authentication package, complete the following steps.
  1. Ensure that your project
    manifest.json
    file contains an entry for
    com.unity.services.authentication
    .
    For more information, refer to the Unity documentation on the Project manifest.
  2. Initialize
    UnityServices
    by implementing the following code snippet into a script that runs before using any Vivox functionality.
using System;using UnityEngine;using Unity.Services.Authentication;using Unity.Services.Core;using Unity.Services.Vivox;async void Start(){ await UnityServices.InitializeAsync(); await AuthenticationService.Instance.SignInAnonymouslyAsync(); await VivoxService.Instance.InitializeAsync();}
  1. Log in by using
    VivoxService.Instance.LoginAsync(LoginOptions options = null)
    .
  2. Join a channel by using either of the following code examples depending on the type of channel.
When joining a non-positional channel use:
VivoxService.Instance.JoinGroupChannelAsync( string channelName, ChatCapability chatCapability, ChannelOptions channelOptions = null);
When joining a positional channel use:
VivoxService.Instance.JoinPositionalChannelAsync( string channelName, ChatCapability chatCapability, Channel3DProperties positionalChannelProperties, ChannelOptions channelOptions = null);
When joining an echo channel use:
VivoxService.Instance.JoinEchoChannelAsync( string channelName, ChatCapability chatCapability, ChannelOptions channelOptions = null);