Beispiel #1
0
        public static void onItemPurchased(ItemPurchasedEvent _Event, bool alsoPush)
        {
            SoomlaWpStore.domain.PurchasableVirtualItem purchasableVirtualItem = _Event.GetPurchasableVirtualItem();
            String payload = _Event.GetPayload();

            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onItemPurchased:" + purchasableVirtualItem.getItemId() + " " + payload);
            PurchasableVirtualItem pvi = (PurchasableVirtualItem)StoreInfo.GetItemByItemId(purchasableVirtualItem.getItemId());

            StoreEvents.OnItemPurchased(pvi, payload);

            if (alsoPush)
            {
                sep.PushEventOnItemPurchased(_Event);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles an <c>onItemPurchased</c> event, which is fired when a specific
        /// <c>PurchasableVirtualItem</c> has been purchased.
        /// </summary>
        /// <param name="message">Message that contains information about the good that has been purchased.</param>
        public void onItemPurchased(string message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onItemPurchased:" + message);

            string[] vars = Regex.Split(message, "#SOOM#");

            PurchasableVirtualItem pvi = (PurchasableVirtualItem)StoreInfo.GetItemByItemId(vars[0]);
            string payload             = "";

            if (vars.Length > 1)
            {
                payload = vars[1];
            }

            StoreEvents.OnItemPurchased(pvi, payload);
        }
Beispiel #3
0
        public void onItemPurchased(string message, bool alsoPush)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onItemPurchased:" + message);

            var eventJSON = new JSONObject(message);

            PurchasableVirtualItem pvi = (PurchasableVirtualItem)StoreInfo.GetItemByItemId(eventJSON["itemId"].str);
            string payload             = "";

            if (eventJSON.HasField("payload"))
            {
                payload = eventJSON["payload"].str;
            }

            StoreEvents.OnItemPurchased(pvi, payload);

            if (alsoPush)
            {
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
                sep.PushEventOnItemPurchased(pvi, payload);
#endif
            }
        }