Example #1
0
        public void SSOAuthFailed(string details)
        {
            authRequested = OKAuthType.None;
            Debug.Log("Received SSO Auth failed callback: " + details);
            bool cancelled;

            if (bool.TryParse(details.Replace("cancelled:", ""), out cancelled) && cancelled)
            {
                Debug.Log("Manual cancelled via Back");
                if (authCallback != null)
                {
                    authCallback(false);
                    authCallback = null;
                }
            }
            else
            {
                if (fallbackToOAuth)
                {
                    Debug.Log("Fallback to OAuth");
                    OAuth();
                }
                else
                {
                    if (authCallback != null)
                    {
                        authCallback(false);
                        authCallback = null;
                    }
                }
            }
        }
Example #2
0
 public void OAuthSuccess(string data)
 {
     string[] args = data.Split(';');
     // Expires_in is no longer mandatory.
     if (args.Length < 2)
     {
         Debug.LogError("Auth failed. Bad argument count - " + args.Length);
         Debug.LogError("Should at least 2: access_token, session_secret_key, expires_in(optional)");
         if (authCallback != null)
         {
             authCallback(false);
             authCallback = null;
         }
         return;
     }
     AccessToken = args[0];
     //temp fix for permissions_granted change
     SessionSecretKey = args[1].Split('&')[0];
     authRequested    = OKAuthType.None;
     AuthType         = OKAuthType.OAuth;
     Debug.Log("Authorized via OAuth!");
     // Send any unsent payment reports.
     ReportPaymentSendInternal();
     if (authCallback != null)
     {
         authCallback(true);
         authCallback = null;
     }
     HideWebView();
 }
Example #3
0
 public void OAuthFailed(string details)
 {
     authRequested = OKAuthType.None;
     Debug.LogError("Received OAuth failed callback: " + details);
     if (authCallback != null)
     {
         authCallback(false);
         authCallback = null;
     }
     HideWebView();
 }
Example #4
0
        private void OAuth()
        {
            if (Application.isEditor)
            {
                Debug.Log("Authorization unavailable in Unity Editor");
                return;
            }

            if (clearTokenOnAuth)
            {
                ClearTokens();
            }
            authRequested = OKAuthType.OAuth;
            OpenWebView(GetAuthUrl());
        }
Example #5
0
        public void RefreshOAuth(OKAuthCallback action)
        {
            authCallback = action;
            if (Application.isEditor)
            {
                Debug.Log("Authorization unavailable in Unity Editor");
                if (authCallback != null)
                {
                    authCallback(false);
                    authCallback = null;
                }
                return;
            }

            if (clearTokenOnAuth)
            {
                ClearTokens(false);
            }
            authRequested = OKAuthType.OAuth;
            OpenWebView(GetAuthUrl());
        }
        private void OAuth()
        {
            if (Application.isEditor)
            {
                Debug.Log("Authorization unavailable in Unity Editor");
                return;
            }

            if (clearTokenOnAuth)
            {
                ClearTokens();
            }
            authRequested = OKAuthType.OAuth;
            OpenWebView(GetAuthUrl());
        }
 public void SSOAuthFailed(string details)
 {
     authRequested = OKAuthType.None;
     Debug.Log("Received SSO Auth failed callback: " + details);
     bool cancelled;
     if (bool.TryParse(details.Replace("cancelled:", ""), out cancelled) && cancelled)
     {
         Debug.Log("Manual cancelled via Back");
         if (authCallback != null)
         {
             authCallback(false);
             authCallback = null;
         }
     }
     else
     {
         if (fallbackToOAuth)
         {
             Debug.Log("Fallback to OAuth");
             OAuth();
         }
         else
         {
             if (authCallback != null)
             {
                 authCallback(false);
                 authCallback = null;
             }
         }
     }
 }
        public void RefreshOAuth(OKAuthCallback action)
        {
            authCallback = action;
            if (Application.isEditor)
            {
                Debug.Log("Authorization unavailable in Unity Editor");
                if (authCallback != null)
                {
                    authCallback(false);
                    authCallback = null;
                }
                return;
            }

            if (clearTokenOnAuth)
            {
                ClearTokens(false);
            }
            authRequested = OKAuthType.OAuth;
            OpenWebView(GetAuthUrl());
        }
 public void OAuthSuccess(string data)
 {
     string[] args = data.Split(';');
     // Expires_in is no longer mandatory.
     if (args.Length < 2)
     {
         Debug.LogError("Auth failed. Bad argument count - " + args.Length);
         Debug.LogError("Should at least 2: access_token, session_secret_key, expires_in(optional)");
         if (authCallback != null)
         {
             authCallback(false);
             authCallback = null;
         }
         return;
     }
     AccessToken = args[0];
     //temp fix for permissions_granted change
     SessionSecretKey = args[1].Split('&')[0];
     authRequested = OKAuthType.None;
     AuthType = OKAuthType.OAuth;
     Debug.Log("Authorized via OAuth!");
     // Send any unsent payment reports.
     ReportPaymentSendInternal();
     if (authCallback != null)
     {
         authCallback(true);
         authCallback = null;
     }
     HideWebView();
 }
 public void OAuthFailed(string details)
 {
     authRequested = OKAuthType.None;
     Debug.LogError("Received OAuth failed callback: " + details);
     if (authCallback != null)
     {
         authCallback(false);
         authCallback = null;
     }
     HideWebView();
 }