Example #1
0
        /**
         * Buys the virtual item with real money (from the Market).
         *
         * @throws com.soomla.store.exceptions.InsufficientFundsException
         */
        public override void buy(String payload)
        {
            SoomlaUtils.LogDebug(TAG, "Starting in-app purchase for productId: "
                                 + mMarketItem.getProductId());


            BusProvider.Instance.Post(new ItemPurchaseStartedEvent(getAssociatedItem()));

            try {
                SoomlaStore.GetInstance().buyWithMarket(mMarketItem, payload);
            } catch (Exception e) {
                SoomlaUtils.LogError(TAG, "Error when purchasing item " + e.Message);
            }
        }
Example #2
0
        // Constructeur
        public MainPage()
        {
            InitializeComponent();
            StoreEvents.GetInstance().OnCurrencyBalanceChangedEvent += new CurrencyBalanceChangedEventHandler(UpdateCurrencyBalance);
            StoreEvents.GetInstance().OnGoodBalanceChangedEvent     += new GoodBalanceChangedEventHandler(UpdateGoodBalance);
            StoreEvents.GetInstance().OnGoodEquippedEvent           += new GoodEquippedEventHandler(UpdateGoodEquip);
            StoreEvents.GetInstance().OnGoodUnEquippedEvent         += new GoodUnEquippedEventHandler(UpdateGoodUnequip);

            SoomlaConfig.logDebug = true;
            Soomla.initialize("this_is_my_secret");
            SoomlaStore.GetInstance().initialize(new StoreAssets(), true);

            /// Update the currencies balance on the GUI
            UpdateCurrencyBalance(null, 0, 0);
            buildShop();
        }