private void HandleLimitedDeviceExchanged(LimitedDeviceExchanger obj) { if (limitedDeviceExchanger.IsError) { Debug.LogError("UnityGoogleDrive: Failed to open device Portal"); HandleProvideAccessTokenComplete(true); } else { UserDeviceAuthorizationHandler.Open(limitedDeviceExchanger, PollCoroutine()); //Step 2 } }
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; }
public static void Open(LimitedDeviceExchanger limitedDeviceExchanger, IEnumerator pollCoroutine) { instance.limitedDeviceExchanger = limitedDeviceExchanger; instance.GetComponent <IShowDeviceCodeCallback>().Show(limitedDeviceExchanger); instance.StartCoroutine(pollCoroutine); }