Authentication Hang

Hi,

I might be misunderstanding something, but it seems like async isn’t working? When I authenticate the user, my game freezes for around 2-3 seconds as it authenticated.

  1. Load in Scene
  2. On Scene Start - Authenticate User and also Play video

Do I misunderstand async or is there a bug? Why when I authenticate the user does the video not play until the authentication is finished?

    private async void Start()
    {
        if(Utilities.CheckForInternetConnection())
        {
            await InitializeUnityServices();
            await SignInUser();
        }
    }
    private async Task InitializeUnityServices()
    {
        InitializationOptions options = new InitializationOptions();
 
        #if UNITY_EDITOR || DEBUG_TOOLS
        options.SetEnvironmentName("development");
        #else
        options.SetEnvironmentName("production");
        #endif

        if(UnityServices.State == ServicesInitializationState.Uninitialized)
        {
            await UnityServices.InitializeAsync();
        } 
    }

    private async Task SignInUser()
    {
        if(!AuthenticationService.Instance.IsSignedIn)
        {
            await AuthenticationService.Instance.SignInAnonymouslyAsync();
        }
    }

Thanks

Utilities.CheckForInternetConnection() is the issue as it is not async? It hangs for 2 to 3 seconds.

Is this going to be fixed or is there a different method for checking if connected to the internet that is async.

Thanks.

Is there any insight into this?

@Julian-Unity3D

Is there going to be a async method for this?