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.
-
Ensure that your project file contains an entry for
manifest.json. For more information, refer to the Unity documentation on the Project manifest.com.unity.services.authentication -
Initialize by implementing the following code snippet into a script that runs before using any Vivox functionality.
UnityServices
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();}
-
Log in by using .
VivoxService.Instance.LoginAsync(LoginOptions options = null) - Join a channel by using either of the following code examples depending on the type of channel.
When joining a positional channel use:VivoxService.Instance.JoinGroupChannelAsync( string channelName, ChatCapability chatCapability, ChannelOptions channelOptions = null);
When joining an echo channel use:VivoxService.Instance.JoinPositionalChannelAsync( string channelName, ChatCapability chatCapability, Channel3DProperties positionalChannelProperties, ChannelOptions channelOptions = null);
VivoxService.Instance.JoinEchoChannelAsync( string channelName, ChatCapability chatCapability, ChannelOptions channelOptions = null);