src/ApprienUnitySDK/Assets/Apprien/ExampleStoreContent/Scripts/ExampleStoreUIController.cs
/// <summary>
/// Get the price for the given IAP from the Store
/// </summary>
Get the price for the given IAP from the Store
Get the price for the given IAP from the Store
public void RefreshUI()
        {
            var iapProducts = _storeController.products;
            for (var i = 0; i < _apprienProducts.Length; i++)
            {
                var apprienProduct = _apprienProducts[i];
                var iapApprienProduct = iapProducts.WithID(apprienProduct.ApprienVariantIAPId);
                var iapStandardProduct = iapProducts.WithID(apprienProduct.BaseIAPId);
                var apprienPrice = iapApprienProduct.metadata.localizedPriceString;
                var standardPrice = iapStandardProduct.metadata.localizedPriceString;
                standardPriceLabels[i].text = standardPrice;
                dynamicPriceLabels[i].text = apprienPrice;
                var productName = _currentTab == TabType.IAPs ? "Product" : "Subscription";
                productName += " " + (i + 1);
                productTitleLabels[i].text = productName;
                standardPriceIdLabels[i].text = apprienProduct.BaseIAPId;
                dynamicPriceIdLabels[i].text = apprienProduct.ApprienVariantIAPId;
            }
            StartCoroutine(_apprienManager.ProductsShown(_apprienProducts));
        }
public void RefreshUI ( ) { var iapProducts = _storeController . products ; for ( var i = 0 ; i < _apprienProducts . Length ; i ++ ) { var apprienProduct = _apprienProducts [ i ] ; var iapApprienProduct = iapProducts . WithID ( apprienProduct . ApprienVariantIAPId ) ; var iapStandardProduct = iapProducts . WithID ( apprienProduct . BaseIAPId ) ; var apprienPrice = iapApprienProduct . metadata . localizedPriceString ; var standardPrice = iapStandardProduct . metadata . localizedPriceString ; standardPriceLabels [ i ] . text = standardPrice ; dynamicPriceLabels [ i ] . text = apprienPrice ; var productName = _currentTab == TabType . IAPs ? " " : " " ; productName += " " + ( i + 1 ) ; productTitleLabels [ i ] . text = productName ; standardPriceIdLabels [ i ] . text = apprienProduct . BaseIAPId ; dynamicPriceIdLabels [ i ] . text = apprienProduct . ApprienVariantIAPId ; } StartCoroutine ( _apprienManager . ProductsShown ( _apprienProducts ) ) ; }
Get the price for the given IAP from the Store
Get the price for the given IAP from the Store
// Update the product title // TODO: if needed later, might use iapProducts.WithID(apprienProduct.BaseIAPId).metadata.localizedTitle // Update the Standard IAP ids to text // Update the Apprien IAP ids to text // Tell Apprien that the products were shown