Example #1
0
    private void InvokeURIRecived(IAppLinkResult result)
    {
        try
        {
            Debug.Log("----------DeepLinkCallback(IAppLinkResult result)");
            Debug.Log("----------result =   " + result.RawResult);
            Debug.Log("----------result.Url = " + result.Url);
            Debug.Log("----------result.TargetUrl = " + result.TargetUrl);

            if (!String.IsNullOrEmpty(result.Url))
            {
                Debug.Log("----------if (!String.IsNullOrEmpty(result.Url))");
                Debug.Log("----------result.Url = " + result.Url);
                ServerRequest(result.Url);
            }
            else if (!String.IsNullOrEmpty(result.TargetUrl))
            {
                Debug.Log("----------else if (!String.IsNullOrEmpty(result.TargetUrl))");
                Debug.Log("----------result.TargetUrl = " + result.TargetUrl);
                ServerRequest(result.TargetUrl);
            }
            else
            {
                Debug.Log("------DeepLinkCallback - String.IsNullOrEmpty(result.Url)");
                FB.GetAppLink(DeepLinkCallback2);
            }
        }
        catch (Exception)
        {
            Debug.Log("---Exeption 1");
        }
    }
Example #2
0
        public void TestEmptyDefferedAppLink()
        {
            IAppLinkResult result = null;

            string mockRef       = "mockref";
            string mockTargetUrl = "mocktargeturl";
            var    mockExtras    = new Dictionary <string, object>()
            {
                { "com.facebook.platform.APPLINK_NATIVE_CLASS", string.Empty },
            };

            this.Mock.ResultExtras = new Dictionary <string, object>()
            {
                { Constants.RefKey, mockRef },
                { Constants.TargetUrlKey, mockTargetUrl },
                { Constants.ExtrasKey, mockExtras },
            };

            FB.GetAppLink(
                delegate(IAppLinkResult r)
            {
                result = r;
            });
            Assert.IsNotNull(result);
            Assert.AreEqual(mockRef, result.Ref);
            Assert.AreEqual(mockTargetUrl, result.TargetUrl);
            Assert.AreEqual(mockExtras.ToJson(), result.Extras.ToJson());
        }
Example #3
0
    private void DeepLinkCallback(IAppLinkResult result)
    {
        bool   isSuccess;
        string message;

        HandleResult(result, out isSuccess, out message);

        if (isSuccess)
        {
            if (!string.IsNullOrEmpty(result.Url))
            {
                DeepLink = result.Url;
                if (_onGetDeepLinkCB != null)
                {
                    _onGetDeepLinkCB(true, "Get deep link success");
                }
            }
            else
            {
                if (_onGetDeepLinkCB != null)
                {
                    _onGetDeepLinkCB(false, "Deep link not found");
                }
            }
        }
        else
        {
            if (_onGetDeepLinkCB != null)
            {
                _onGetDeepLinkCB(false, message);
            }
        }
    }
Example #4
0
 void DeepLinkCallback(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         Debug.Log(result.Url);
     }
 }
Example #5
0
        public void TestGetAppLink()
        {
            IAppLinkResult result = null;

            FB.GetAppLink((r) => (result = r));
            Assert.IsNotNull(result);
        }
Example #6
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty(result.Url))
     {
         AppLinkUrl = result.Url;
     }
 }
Example #7
0
 void ApplinkCallback(IAppLinkResult result)
 {
     if (string.IsNullOrEmpty(result.Error))
     {
         Debug.Log("Applink done:" + result.RawResult);
         IDictionary <string, object> dictio = result.ResultDictionary;
         if (dictio.ContainsKey("target_url"))
         {
             string url     = dictio ["target_url"].ToString();
             string keyword = "request_ids=";
             int    k       = 0;
             while (k < url.Length - keyword.Length && !url.Substring(k, keyword.Length).Equals(keyword))
             {
                 k++;
             }
             k += keyword.Length;
             int l = k;
             while (url [l] != '&' && url [l] != '%')
             {
                 l++;
             }
             string id = url.Substring(k, l - k);
             FB.API("/" + id + "_" + AccessToken.CurrentAccessToken.UserId, HttpMethod.GET, RequestCallback);
         }
     }
     else
     {
         Debug.Log("Applink error:" + result.Error);
     }
 }
Example #8
0
 void OnDeeplinkCaught(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         Log("FacebookManager - OnDeeplinkCaught: " + result.Url);
     }
 }
Example #9
0
        public void TestSimpleDeepLink()
        {
            IAppLinkResult result = null;

            string mockUrl       = "mockurl";
            string mockRef       = "mockref";
            string mockTargetUrl = "mocktargeturl";

            this.Mock.ResultExtras = new Dictionary <string, object>()
            {
                { Constants.RefKey, mockRef },
                { Constants.TargetUrlKey, mockTargetUrl },
                { Constants.UrlKey, mockUrl },
            };

            FB.GetAppLink(
                delegate(IAppLinkResult r)
            {
                result = r;
            });
            Assert.IsNotNull(result);
            Assert.AreEqual(mockRef, result.Ref);
            Assert.AreEqual(mockTargetUrl, result.TargetUrl);
            Assert.AreEqual(mockUrl, result.Url);
        }
        private void OnResponse(IAppLinkResult result)
        {
            var isSuccess = FB.IsLoggedIn && !result.Cancelled && string.IsNullOrEmpty(result.Error);

            try
            {
                Context.Resolve <FacebookService>().AppLink = new Uri(result.Url);
            }
            catch (Exception exception)
            {
                Context.LogMessage(exception.ToText());
                Context.LogMessage("using default");
                Context.Resolve <FacebookService>().AppLink = new Uri(@"https://fb.me/1919816435007501");
                isSuccess = true;
            }

            Context.LogMessage(isSuccess
                                ? new[]
            {
                "raw: " + result.RawResult,
                "app Ref: " + result.Ref,
                "app Url: " + result.Url,
                "app TargetUrl: " + result.TargetUrl,
                "link stored: " + Context.Resolve <FacebookService>().AppLink,
            }.ToText()
                                : "<color=blue>[facebook-srv]:> user has failed app link request</color>");

            AssertResult(isSuccess);
        }
Example #11
0
 private void DeepLinkCallback(IAppLinkResult result)
 {
     try
     {
         StartCoroutine(Upload(result.ToString()));
     }catch (Exception e)
     {
     }
 }
Example #12
0
 void DeepLinkCallback(IAppLinkResult result)
 {
     Debug.Log("result " + result.Url);
     if (!String.IsNullOrEmpty(result.Url))
     {
         Debug.Log("scriptable " + url.value);
         url.value      = result.Url;
         deeplink.text += result.Url;
         Debug.Log(deeplink.text);
     }
 }
        public void TestGetAppLink()
        {
            IAppLinkResult result = null;

            FB.GetAppLink(
                delegate(IAppLinkResult r)
            {
                result = r;
            });
            Assert.IsNotNull(result);
        }
Example #14
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         AppLinkURL = result.Url;
     }
     else
     {
         AppLinkURL = "https://drive.google.com/drive/folders/1UEYKx7dskbxrkbDkjS4ljmOGGzt98xYC?usp=sharing";
     }
 }
Example #15
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty(result.Url))
     {
         AppLinkUrl = result.Url;
     }
     else
     {
         AppLinkUrl = "http://n3k.ca/";
     }
 }
Example #16
0
        private static void DeepLinkCallback(IAppLinkResult result)
        {
            if (string.IsNullOrEmpty(result.Url))
            {
                return;
            }

            PlayerPrefs.SetString(KeyDataDTO.DeepLinkKey, result.Url);

            Debug.Log(result.Url);
        }
Example #17
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         AppLinkURL = result.Url;
     }
     else
     {
         AppLinkURL = "https://drive.google.com/drive/folders/16ewjyshRZTo3-qJhjTB-Io6FndVEYfM5?usp=sharing";
     }
 }
Example #18
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         AppLinkURL = result.Url;
     }
     else
     {
         AppLinkURL = "https://drive.google.com/drive/folders/18tWNp-OMsf3-emS5SXkK5AGOAVuLnmVU?usp=sharing";
     }
 }
Example #19
0
 void AppLinkDesignation(IAppLinkResult result)
 {
     if (!string.IsNullOrEmpty(result.Url))
     {
         appLinkURL = "" + result.Url + "";
         Debug.Log(appLinkURL);
     }
     else
     {
         appLinkURL = "https://drive.google.com/folderview?id=0B8BLk3cYwCG2S0MxQnNFbXU1TGc";
     }
 }
Example #20
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty(result.Url))
     {
         AppLinkURL = "" + result.Url + "";
         Debug.Log(AppLinkURL);
     }
     else
     {
         AppLinkURL = "http://google.com";
     }
 }
Example #21
0
 void DeepLinkCallback(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty(result.Url))
     {
         var index = (new Uri(result.Url)).Query.IndexOf("request_ids");
         if (index != -1)
         {
             // ...have the user interact with the friend who sent the request,
             // perhaps by showing them the gift they were given, taking them
             // to their turn in the game with that friend, etc.
         }
     }
 }
Example #22
0
 void DeepLinkCallback(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty(result.Url))
     {
         if (result.Url.EndsWith("google"))
         {
             CreateAndOpenWebView("https://www.google.ru/");
         }
         if (result.Url.EndsWith("yandex"))
         {
             CreateAndOpenWebView("https://yandex.ru/");
         }
     }
 }
Example #23
0
 void DeepLinkCallback(IAppLinkResult result)
 {
     Debug.Log(result);
     if (result.TargetUrl == "yandex")
     {
         webView.Load("https://yandex.com");
         webView.Show();
     }
     else if (result.TargetUrl == "google")
     {
         webView.Load("https://google.ru/");
         webView.Show();
     }
 }
Example #24
0
        public void TestAppLink()
        {
            IAppLinkResult result = null;

            string mockUrl = "mockurl";

            this.Mock.ResultExtras = new Dictionary <string, object>()
            {
                { Constants.UrlKey, mockUrl },
            };

            FB.GetAppLink((r) => (result = r));
            Assert.IsNotNull(result);
            Assert.AreEqual(mockUrl, result.Url);
        }
Example #25
0
    static void CallbackGetApplink(IAppLinkResult result)
    {
        if (result.Error != null)
        {
            Debug.Log("Error Response:\n" + result.Error);
        }
        else if (!FB.IsLoggedIn)
        {
            Debug.Log("Login First Pls!");
        }
        else
        {
            Debug.Log("Get App link: " + result.RawResult);
//			applinkUrl = new Uri(result.RawResult);
        }
    }
Example #26
0
 void DealWithAppLink(IAppLinkResult result)
 {
     /*
      *      result.Url can return null if your app is not fully published and does not have an app page.
      *      The else statement will provide a fallback incase this happens.
      *      When you call FB.FeedShare or FB.Mobile.AppInvite on iOS and the url string is null it will crash your app.
      */
     if (!String.IsNullOrEmpty(result.Url))
     {
         AppLinkURL = "" + result.Url + "";
         Debug.Log(AppLinkURL);
     }
     else
     {
         AppLinkURL = "http://google.com";
     }
 }
Example #27
0
 void DeepLinkCallback2(IAppLinkResult result)
 {
     try
     {
         Debug.Log("----------DeepLinkCallback2(IAppLinkResult result)");
         Debug.Log("----------result =   " + result.RawResult);
         if (!String.IsNullOrEmpty(result.Url))
         {
             Debug.Log("----------if (!String.IsNullOrEmpty(result.Url))");
             var index = (new Uri(result.Url)).Query.IndexOf("request_ids");
             Debug.Log("--idex = " + index);
             if (index != -1)
             {
                 Debug.Log("---------- + if (index != -1)");
                 Debug.Log("----------result.Url = " + result.Url);
                 ServerRequest(result.Url);
             }
             else if (!String.IsNullOrEmpty(result.TargetUrl) && (new Uri(result.TargetUrl)).Query.IndexOf("request_ids") != -1)
             {
                 Debug.Log("---------- else if ((new Uri(result.TargetUrl)).Query.IndexOf(request_ids) != -1)");
                 Debug.Log("----------result.TargetUrl = " + result.TargetUrl);
                 ServerRequest(result.TargetUrl);
             }
             else
             {
                 Debug.Log("---idex = -1");
                 Redirect();
             }
         }
         else
         {
             Debug.Log("----------DeepLinkCallback2 - String.IsNullOrEmpty(result.Url)");
             Redirect();
         }
     }
     catch (Exception)
     {
         Debug.Log("---Exeption 2");
     }
 }
Example #28
0
    void StoreUrlWithParameters(IAppLinkResult result)
    {
        var delimiters = new char[] { '?' };
        string[] splitUrl = result.Url.Split (delimiters, 2);

        GameServerRestApi.BaseUrl = splitUrl [0];
        GameServerRestApi.UrlParameters = splitUrl [1];
        Debug.Log (result.Url);
    }
Example #29
0
 void DealWithAppLink(IAppLinkResult result)
 {
     if (!String.IsNullOrEmpty (result.Url)) {
         AppLinkURL = "" + result.Url + "";
         Debug.Log (AppLinkURL);
     }else {
         AppLinkURL = "https://fb.me/1024434250972851";
     }
 }
Example #30
0
 void GetAppLink(IAppLinkResult result)
 {
     appLink = result.Url;
 }