src/ApprienUnitySDK/Assets/Apprien/ExampleStoreContent/Scripts/ExampleStoreUIController.cs
/// <summary>
/// Fetch Apprien variant IAP ids and re-initialize UnityPurchasing
/// </summary>
Fetch Apprien variant IAP ids and re-initialize UnityPurchasing
Fetch Apprien variant IAP ids and re - initialize UnityPurchasing
private void FetchPrices()
        {
            StartCoroutine(
                _apprienManager.FetchApprienPrices(
                    _apprienProducts,
                    () =>
                    {
                        foreach (var product in _apprienProducts)
                        {
                            _builder.AddProduct(product.ApprienVariantIAPId, product.ProductType);
                        }
                        UnityPurchasing.Initialize(this, _builder);
                    }
                )
            );
        }
private void FetchPrices ( ) { StartCoroutine ( _apprienManager . FetchApprienPrices ( _apprienProducts , ( ) => { foreach ( var product in _apprienProducts ) { _builder . AddProduct ( product . ApprienVariantIAPId , product . ProductType ) ; } UnityPurchasing . Initialize ( this , _builder ) ; } ) ) ; }
Fetch Apprien variant IAP ids and re-initialize UnityPurchasing
Fetch Apprien variant IAP ids and re - initialize UnityPurchasing
// Update the products with Apprien IAP ids // The products will now contain updated IAP ids. Add them to the product builder // If the connection failed or the variants were not fetched for some reason // this will add duplicates to the builder, which will ignore them safely. // Apprien variant IAP id. If connection failed, the variant IAP id // defaults to the base IAP id // Initialize UnityPurchasing with the fetched IAP ids