Example #1
0
        public void OnPurchaseStatus(PurchaseStatus status) // IPurchaseListener
        {
            // called from app-store thread -> do not update views (use UI thread instead)

            switch (status)
            {
            case PurchaseStatus.Connected:
                Log("appstore connected");
                LogPurchases();
                break;

            case PurchaseStatus.Disconnected:
                Log("appstore disconnected");
                Dispose();
                break;

            case PurchaseStatus.Purchased:
                Log("appstore purchased");
                Analytics.TrackPurchase(Analytics.EVENT_PURCHASE_SUCCESS);
                Dispose();
                break;

            case PurchaseStatus.Consumed:
                Log("appstore *** error *** consumed ***"); // should never happen
                break;

            case PurchaseStatus.Cancelled:
                Log("appstore cancelled");
                Analytics.TrackPurchase(Analytics.EVENT_PURCHASE_CANCEL);
                Dispose();
                break;

            default:
                Dispose();
                break;
            }
        }
Example #2
0
 void OnAppStoreClicked(object sender, EventArgs args)
 {
     Analytics.TrackPurchase(Analytics.EVENT_PURCHASE_REQUEST);
     AppStore.Instance.SetListener(this);
     AppStore.Instance.Purchase();
 }