コード例 #1
0
        protected void HandleDeeplink(string url, string actionType)
        {
            if (actionType == null)
            {
                actionType = SWRVE_AD_REENGAGE;
            }

            if (!IsSwrveDeeplink(url))
            {
                return;
            }

            Dictionary <string, string> queryParams = SwrveHelper.GetUriQueryParameters((new Uri(url)).Query);

            if (queryParams.Count > 0)
            {
                string adSource     = queryParams [SWRVE_AD_SOURCE];
                string campaignName = queryParams [SWRVE_AD_CAMPAIGN];
                string campaignID   = queryParams [SWRVE_AD_CONTENT];

                string getRequest = CreateCampaignUrl(campaignID);
                container.StartCoroutine(GetExternalCampaign_Coroutine(getRequest));
                QueueDeeplinkGenericEvent(adSource, campaignID, campaignName, actionType);
            }
        }
コード例 #2
0
 public static bool IsSwrveDeeplink(string url)
 {
     if (!String.IsNullOrEmpty(url))
     {
         try {
             Dictionary <string, string> queryParams = SwrveHelper.GetUriQueryParameters((new Uri(url)).Query);
             if (queryParams.ContainsKey(SWRVE_AD_CONTENT))
             {
                 return(true);
             }
         } catch (Exception exception) {
             SwrveLog.LogError("SwrveDeeplink URI parsing failed with the following exception: " + exception);
         }
     }
     return(false);
 }