public void _OnStatsUpdated(string unused)
 {
     if (PubServices.OnStatsUpdated != null)
     {
         PubServices.OnStatsUpdated();
     }
 }
        public void _OnURLOpened(string paramJson)
        {
            Hashtable values = (AdColonyJson.Decode(paramJson) as Hashtable);

            string    url       = "";
            Hashtable urlParams = null;
            bool      handled   = false;

            if (values.ContainsKey("url"))
            {
                url = values["url"] as string;
            }
            if (values.ContainsKey("url_params"))
            {
                urlParams = (AdColonyJson.Decode(values["url_params"] as string) as Hashtable);
            }
            if (values.ContainsKey("handled"))
            {
                handled = (bool)values["handled"];
            }

            if (PubServices.OnURLOpened != null)
            {
                PubServices.OnURLOpened(url, urlParams, handled);
            }
        }
 public void _OnVIPInformationUpdated(string unused)
 {
     if (PubServices.OnVIPInformationUpdated != null)
     {
         PubServices.OnVIPInformationUpdated();
     }
 }
 public void _OnOverlayVisibilityChanged()
 {
     if (PubServices.OnOverlayVisibilityChanged != null)
     {
         PubServices.OnOverlayVisibilityChanged();
     }
 }
 public void _OnRegisteredForPushNotificationsFailed(string error)
 {
     UnityEngine.Debug.Log("_OnRegisteredForPushNotificationsFailed: " + error);
     if (PubServices.OnRegisteredForPushNotificationsFailed != null)
     {
         PubServices.OnRegisteredForPushNotificationsFailed(error);
     }
 }
 public void _OnRegisteredForPushNotifications(string deviceToken)
 {
     UnityEngine.Debug.Log("_OnRegisteredForPushNotifications: " + deviceToken);
     if (PubServices.OnRegisteredForPushNotifications != null)
     {
         PubServices.OnRegisteredForPushNotifications(deviceToken);
     }
 }
        public void _OnPushNotificationReceived(string paramJson)
        {
            UnityEngine.Debug.Log("_OnPushNotificationReceived: " + paramJson);
            Hashtable values = (AdColonyJson.Decode(paramJson) as Hashtable);

            AdColony.PubServicesPushNotification pushNotification = new PubServicesPushNotification(values);
            if (PubServices.OnPushNotificationReceived != null)
            {
                PubServices.OnPushNotificationReceived(pushNotification);
            }
        }
 public void _OnGrantDigitalProductItem(string digitalItemJson)
 {
     UnityEngine.Debug.Log("GrantDigitalProductItem(" + digitalItemJson + ")");
     try {
         Hashtable values = (AdColonyJson.Decode(digitalItemJson) as Hashtable);
         if (values != null)
         {
             PubServicesDigitalItem digitalItem = new PubServicesDigitalItem(values);
             if (digitalItem != null)
             {
                 if (PubServices.OnGrantDigitalProductItem != null)
                 {
                     PubServices.OnGrantDigitalProductItem(digitalItem);
                 }
             }
         }
     } catch (Exception e) {
         UnityEngine.Debug.Log("Exception caught in CanGrantDigitalProductItem, " + e);
     }
 }
        public void _OnIAPProductPurchaseFailed(string paramJson)
        {
            string productId = "";
            string error     = "";

            Hashtable values = (AdColonyJson.Decode(paramJson) as Hashtable);

            if (values.ContainsKey("product_id"))
            {
                productId = values["product_id"] as string;
            }
            if (values.ContainsKey("error"))
            {
                error = values["error"] as string;
            }

            if (PubServices.OnInAppPurchaseRewardFailed != null)
            {
                PubServices.OnInAppPurchaseRewardFailed(productId, error);
            }
        }
        // Multiple items returned as JSON string
        public void _OnIAPProductPurchased(string paramJson)
        {
            int    inGameCurrencyBonus = 0;
            string productId           = "";

            Hashtable values = (AdColonyJson.Decode(paramJson) as Hashtable);

            if (values.ContainsKey("product_id"))
            {
                productId = values["product_id"] as string;
            }
            if (values.ContainsKey("in_game_currency_bonus"))
            {
                inGameCurrencyBonus = Convert.ToInt32(values["in_game_currency_bonus"]);
            }

            if (PubServices.OnInAppPurchaseReward != null)
            {
                PubServices.OnInAppPurchaseReward(productId, inGameCurrencyBonus);
            }
        }
        public void _OnServiceAvailabilityChanged(string value)
        {
            UnityEngine.Debug.Log("_OnServiceAvailabilityChanged called");
            string error = "";
            PubServicesStatusType status = PubServicesStatusType.Unknown;

            Hashtable values = (AdColonyJson.Decode(value) as Hashtable);

            if (values.ContainsKey("error"))
            {
                error = values["error"] as string;
            }

            if (values.ContainsKey("status"))
            {
                int temp = Convert.ToInt32(values["status"]);
                status = (PubServicesStatusType)temp;
            }

            if (PubServices.OnServiceAvailabilityChanged != null)
            {
                PubServices.OnServiceAvailabilityChanged(status, error);
            }
        }