private QLStoreOpenSource MapStoreOpenSource(QLPurchaseSource purchaseSource)
        {
            switch (purchaseSource)
            {
            case QLPurchaseSource.QLPurchaseSourceMenu:
                return(QLStoreOpenSource.QLStoreOpenSourceMenu);

            case QLPurchaseSource.QLPurchaseSourceHint:
                return(QLStoreOpenSource.QLStoreOpenSourceHint);

            case QLPurchaseSource.QLPurchaseSourceGold:
                return(QLStoreOpenSource.QLStoreOpenSourceGold);

            case QLPurchaseSource.QLPurchaseSourceReplay:
                return(QLStoreOpenSource.QLStoreOpenSourceReplay);

            case QLPurchaseSource.QLPurchaseSourceCollection:
                return(QLStoreOpenSource.QLStoreOpenSourceCollection);

            case QLPurchaseSource.QLPurchaseSourceFilm:
                return(QLStoreOpenSource.QLStoreOpenSourceFilm);

            case QLPurchaseSource.QLPurchaseSourceInGame:
                return(QLStoreOpenSource.QLStoreOpenSourceInGame);

            default:
                //TODO add asset here? -> SHouldn't reach here
                return(QLStoreOpenSource.QLStoreOpenSourceMenu);
            }
        }
Exemple #2
0
        public QLPurchase(QLPurchaseState PurchaseState, string ProductId, float Price, string Currency, int Reward, QLPurchaseSource Source, string FailReason = null)
        {
            this.PurchaseState = PurchaseState;

            this.ProductId = ProductId;

            this.Price = Price;

            this.Currency = Currency;

            this.Reward = Reward;

            this.Source = Source;

            this.FailReason = FailReason;
        }
Exemple #3
0
        public void OpenStore(Action closed, QLPurchaseSource source)
        {
            storeOpenSource = source;
            storeClosed     = closed;

            SceneActivationBehaviour <GameLogicActivator> .Instance.AnalyticsController.StoreOpenEvent();

            SceneActivationBehaviour <BoardUIActivator> .Instance.PauseGameHandler();

            SceneActivationBehaviour <OverlayUISceneActivator> .Instance.ShowLoadingScreen();

            if (!IsStoreInitialized())
            {
                purchaser.InitializePurchasing(StoreLoadedCompletion, StoreLoadErrorCompletion);
            }
            else
            {
                StoreLoadedCompletion();
            }
        }
        // Store PURCHASE

        public void SendPurchaseEvent(QLPurchaseState state, string productId, float price, string currency, int reward, QLPurchaseSource source, string failReason = null)
        {
            if (state == QLPurchaseState.QLPurchaseStateSucceded)
            {
                AdjustEvent adjustEvent = new AdjustEvent(Constants.Analytics.AdjustEvents.Purchase);
                adjustEvent.setRevenue(Convert.ToDouble(price), currency);
                Adjust.trackEvent(adjustEvent);
            }

            QLPurchase purchaseEvent = new QLPurchase(state, productId, price, currency, reward, source, failReason);

            TrackEvent(purchaseEvent);
        }