Hi I’m Developed Unity Webgl game. Its work fine when its work on Editor/Mobile
but its not work in Webgl
the error i get
m_Client = new Client("http", m_Host,7350, "defaultkey",UnityWebRequestAdapter.Instance);
Code
public async void LoginWithGuest()
{
authenticationType = AuthenticationType.Guest;
if (m_DeviceId == "")
{
m_DeviceId = SystemInfo.deviceUniqueIdentifier;
}
try
{
// User already Exists
m_Session = await m_Client.AuthenticateDeviceAsync(m_DeviceId, create: false);
PlayerPrefs.SetString("nakama.refreshToken", m_Session.RefreshToken);
PlayerPrefs.SetString("nakama.authToken", m_Session.AuthToken);
Debug.Log(m_Session);
}
catch (Exception e)
{
Debug.LogError("New User Found");
try
{
m_Session = await m_Client.AuthenticateDeviceAsync(m_DeviceId, create: true);
PlayerPrefs.SetString("nakama.refreshToken", m_Session.RefreshToken);
PlayerPrefs.SetString("nakama.authToken", m_Session.AuthToken);
}
catch (Exception ex)
{
Debug.LogError("Error on creating new user "+m_Client );
Debug.LogError("Message "+ ex.Message);
}
}
}