void OnApplicationPause(bool pauseStatus)
 {
     Debug.Log("Application pause?");
     if (pauseStatus == false)
     {
         Debug.Log("and then");
                     #if UNITY_IPHONE
         string passedData = PlayerPrefs.GetString("url_scheme");
         if (passedData != null)
         {
             PlayerPrefs.DeleteKey("url_scheme");
             Debug.Log("url is " + passedData);
             verifyAddress(passedData);
         }
                     #endif
                     #if UNITY_ANDROID
         string query = CustomUrlSchemeAndroid.GetLaunchedUrlQuery();
         if (query != null)
         {
             Debug.Log("Verifying address?");
             verifyAddress(query);
         }
                     #endif
     }
 }
 public void clickVerifyAddress()
 {
     Debug.Log("and then");
             #if UNITY_IPHONE
     string passedData = PlayerPrefs.GetString("url_scheme");
     if (passedData != null)
     {
         PlayerPrefs.DeleteKey("url_scheme");
         Debug.Log("url is " + passedData);
         verifyAddress(passedData);
     }
             #endif
             #if UNITY_ANDROID
     string query = CustomUrlSchemeAndroid.GetLaunchedUrlQuery();
     if (query != null)
     {
         Debug.Log("Verifying address?");
         verifyAddress(query);
     }
     else
     {
         Debug.Log("launched query was null");
     }
             #endif
 }
Esempio n. 3
0
        private void ProcessDeepLink(bool isExternalBrowser, string url = "")
        {
            string linkUrl = url;

            #if UNITY_ANDROID
            //overriden linkUrl if deep link comes from external browser, due to limitations of Android plugins implementation
            if (isExternalBrowser)
            {
                linkUrl = CustomUrlSchemeAndroid.GetLaunchedUrl(true);
                CustomUrlSchemeAndroid.ClearSavedData();
            }
            #endif


            #if UNITY_IOS
            //there is no link override on iOS
            #endif


            if (!string.IsNullOrEmpty(linkUrl))
            {
                Debug.Log("Unity URL returned: " + linkUrl);

                Dictionary <string, string> urlParams = linkUrl.ParseURI();

                //blindcode as unable to test this without API update
                if (urlParams.ContainsKey("code"))
                {
                    //string code = split[1];
                    AuthorizationCodeReceived(urlParams["code"]);
                }
                else if (linkUrl.Contains("requestId="))
                {
                    string transferId = urlParams["requestId"];

                    foreach (TransferAPIRequest r in currentTransferAPIRequests)
                    {
                        Debug.Log("Current requests id: " + r.requestId);
                    }

                    //get request from ongoing
                    TransferAPIRequest transferRequest = currentTransferAPIRequests.Find(t => t.requestId == transferId);
                    if (transferRequest == null)
                    {
                        Debug.LogError("Transfer id is invalid: " + transferId);
                        transferRequest.failedDelegate("Invalid transfer id: " + transferId);
                    }

                    if (urlParams.ContainsKey("error"))
                    {
                        //all requests are validated positivelly currently
                        transferRequest.failedDelegate(urlParams["error"]);
                    }
                    else
                    {
                        transferRequest.txId = urlParams["txId"];
                        Debug.Log("tx id:" + transferRequest.txId);

                        transferRequest.successDelegate(transferRequest.txId);
                    }

                    currentTransferAPIRequests.Remove(transferRequest);
                }
                else
                {
                    Debug.Log("NOT IMPLEMENTED URL: " + linkUrl);
                }
            }
        }