Following the chat channel sample demo scene, I pretty much just copied and pasted the code. Instead of clicking a button to login I just add the login to the start as such from the LoginScreenUI.cs:
private void Awake()
{
_vivoxVoiceManager = VoiceManager.Instance;
_vivoxVoiceManager.OnUserLoggedInEvent += OnUserLoggedIn;
_vivoxVoiceManager.OnUserLoggedOutEvent += OnUserLoggedOut;
#if !(UNITY_STANDALONE || UNITY_IOS || UNITY_ANDROID || UNITY_STADIA)
DisplayNameInput.interactable = false;
#else
// DisplayNameInput.onEndEdit.AddListener((string text) => { LoginToVivoxService(); });
#endif
//LoginButton.onClick.AddListener(() => { LoginToVivoxService(); });
if (_vivoxVoiceManager.LoginState == VivoxUnity.LoginState.LoggedIn)
{
OnUserLoggedIn();
//DisplayNameInput.text = _vivoxVoiceManager.LoginSession.Key.DisplayName;
}
else
{
OnUserLoggedOut();
var systInfoDeviceName = String.IsNullOrWhiteSpace(SystemInfo.deviceName) == false ? SystemInfo.deviceName : Environment.MachineName;
//DisplayNameInput.text = Environment.MachineName.Substring(0, Math.Min(defaultMaxStringLength, Environment.MachineName.Length));
}
}
private void Start()
{
LoginToVivoxService();
}
private void LoginToVivoxService()
{
if (IsMicPermissionGranted())
{
// The user authorized use of the microphone.
LoginToVivox();
}
else
{
// We do not have the needed permissions.
// Ask for permissions or proceed without the functionality enabled if they were denied by the user
if (IsPermissionsDenied())
{
PermissionAskedCount = 0;
LoginToVivox();
}
else
{
AskForPermissions();
}
}
}
private void LoginToVivox()
{
//LoginButton.interactable = false;
/* if (string.IsNullOrEmpty(DisplayNameInput.text))
{
Debug.LogError("Please enter a display name.");
return;
}*/
_vivoxVoiceManager.Login(Guid.NewGuid().ToString());
}
Seems like the name parameter on AccountID is provided by Vivox? In the example scene it does not appear that the user creates name.
Any advice?