public IOSAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
 {
     settings                     = googleDriveSettings;
     accessTokenRefresher         = new AccessTokenRefresher(settings.UriSchemeClientCredentials);
     accessTokenRefresher.OnDone += HandleAccessTokenRefreshed;
     authCodeExchanger            = new AuthCodeExchanger(settings, settings.UriSchemeClientCredentials);
     authCodeExchanger.OnDone    += HandleAuthCodeExchanged;
 }
 public LoopbackAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
 {
     settings                     = googleDriveSettings;
     unitySyncContext             = SynchronizationContext.Current;
     accessTokenRefresher         = new AccessTokenRefresher(settings.GenericClientCredentials);
     accessTokenRefresher.OnDone += HandleAccessTokenRefreshed;
     authCodeExchanger            = new AuthCodeExchanger(settings, settings.GenericClientCredentials);
     authCodeExchanger.OnDone    += HandleAuthCodeExchanged;
 }
        public LoopbackAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
        {
            settings = googleDriveSettings;

            accessTokenRefresher         = new AccessTokenRefresher(settings);
            accessTokenRefresher.OnDone += HandleAccessTokenRefreshed;

            authCodeExchanger         = new AuthCodeExchanger(settings);
            authCodeExchanger.OnDone += HandleAuthCodeExchanged;
        }
 private void HandleAuthCodeExchanged(AuthCodeExchanger exchanger)
 {
     if (authCodeExchanger.IsError)
     {
         Debug.LogError("UnityGoogleDrive: Failed to exchange authorization code.");
         HandleProvideAccessTokenComplete(true);
     }
     else
     {
         settings.CachedAccessToken  = authCodeExchanger.AccesToken;
         settings.CachedRefreshToken = authCodeExchanger.RefreshToken;
         HandleProvideAccessTokenComplete();
     }
 }