コード例 #1
0
 public IOSAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
 {
     settings                     = googleDriveSettings;
     accessTokenRefresher         = new AccessTokenRefresher(settings.UriSchemeClientCredentials);
     accessTokenRefresher.OnDone += HandleAccessTokenRefreshed;
     authCodeExchanger            = new AuthCodeExchanger(settings, settings.UriSchemeClientCredentials);
     authCodeExchanger.OnDone    += HandleAuthCodeExchanged;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        public LoopbackAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
        {
            settings = googleDriveSettings;

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

            authCodeExchanger         = new AuthCodeExchanger(settings);
            authCodeExchanger.OnDone += HandleAuthCodeExchanged;
        }
コード例 #4
0
        public LuminAccessTokenProvider(GoogleDriveSettings googleDriveSettings)
        {
            settings         = googleDriveSettings;
            unitySyncContext = SynchronizationContext.Current;

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

            limitedDeviceExchanger         = new LimitedDeviceExchanger(settings, settings.GenericClientCredentials);
            limitedDeviceExchanger.OnDone += HandleLimitedDeviceExchanged;

            deviceCodeExchanger         = new DeviceCodeExchanger(settings, settings.GenericClientCredentials);
            deviceCodeExchanger.OnDone += HandleDeviceCodeExchanged;
        }
コード例 #5
0
 private void HandleAccessTokenRefreshed (AccessTokenRefresher refresher)
 {
     if (refresher.IsError)
     {
         if (Debug.isDebugBuild)
         {
             var message = "UnityGoogleDrive: Failed to refresh access token; executing full auth procedure.";
             if (!string.IsNullOrEmpty(refresher.Error))
                 message += string.Format("\nDetails: {0}", refresher.Error);
             Debug.Log(message);
         }
         ExecuteFullAuth();
     }
     else
     {
         settings.CachedAccessToken = refresher.AccesToken;
         HandleProvideAccessTokenComplete();
     }
 }