Пример #1
0
        public void _OnIAPOpportunity(string paramJson)
        {
            Hashtable            values       = (AdColonyJson.Decode(paramJson) as Hashtable);
            Hashtable            valuesAd     = null;
            string               iapProductId = null;
            AdsIAPEngagementType engagement   = AdsIAPEngagementType.AdColonyIAPEngagementEndCard;

            if (values.ContainsKey(Constants.OnIAPOpportunityAdKey))
            {
                valuesAd = values[Constants.OnIAPOpportunityAdKey] as Hashtable;
            }
            if (values.ContainsKey(Constants.OnIAPOpportunityEngagementKey))
            {
                engagement = (AdsIAPEngagementType)Convert.ToInt32(values[Constants.OnIAPOpportunityEngagementKey]);
            }
            if (values.ContainsKey(Constants.OnIAPOpportunityIapProductIdKey))
            {
                iapProductId = values[Constants.OnIAPOpportunityIapProductIdKey] as string;
            }

            InterstitialAd ad = GetAdFromHashtable(valuesAd);

            if (Ads.OnIAPOpportunity != null)
            {
                Ads.OnIAPOpportunity(ad, iapProductId, engagement);
            }
        }
Пример #2
0
        public void _OnIAPOpportunity(string paramJson)
        {
            Hashtable values = (AdColonyJson.Decode(paramJson) as Hashtable);

            if (values == null)
            {
                Debug.LogError("Unable to parse parameters in _OnIAPOpportunity, " + (paramJson ?? "null"));
                return;
            }

            Hashtable            valuesAd     = null;
            string               iapProductId = null;
            AdsIAPEngagementType engagement   = AdsIAPEngagementType.AdColonyIAPEngagementEndCard;

            if (values.ContainsKey(Constants.OnIAPOpportunityAdKey))
            {
                valuesAd = (AdColonyJson.Decode(values[Constants.OnIAPOpportunityAdKey] as String)) as Hashtable;
            }
            if (values.ContainsKey(Constants.OnIAPOpportunityEngagementKey))
            {
                engagement = (AdsIAPEngagementType)Convert.ToInt32(values[Constants.OnIAPOpportunityEngagementKey]);
            }
            if (values.ContainsKey(Constants.OnIAPOpportunityIapProductIdKey))
            {
                iapProductId = values[Constants.OnIAPOpportunityIapProductIdKey] as string;
            }

            InterstitialAd ad = GetAdFromHashtable(valuesAd);

            if (ad == null)
            {
                Debug.LogError("Unable to create ad within _OnIAPOpportunity, " + (paramJson ?? "null"));
                return;
            }

            if (Ads.OnIAPOpportunity != null)
            {
                Ads.OnIAPOpportunity(ad, iapProductId, engagement);
            }
        }
Пример #3
0
 private void OnIAPOpportunityHandle(InterstitialAd arg1, string arg2, AdsIAPEngagementType arg3)
 {
 }