src/ApprienUnitySDK/Assets/Apprien/Scripts/ApprienProduct.cs
/// <summary>
/// Convert a Unity IAP Product Catalog into ApprienProduct objects ready for fetching Apprien prices.
/// Does not alter the catalog
/// </summary>
/// <param name="catalog"></param>
/// <returns>Returns an array of Apprien Products built from the given ProductCatalog object</returns>
Convert a Unity IAP Product Catalog into ApprienProduct objects ready for fetching Apprien prices.
Does not alter the catalog
Convert a Unity IAP Product Catalog into ApprienProduct objects ready for fetching Apprien prices . Does not alter the catalog
public static ApprienProduct[] FromIAPCatalog(ProductCatalog catalog)
        {
            var catalogProducts = catalog.allValidProducts;
            var products = new ApprienProduct[catalogProducts.Count];
            var i = 0;
            foreach (var catalogProduct in catalogProducts)
            {
                products[i++] = new ApprienProduct(catalogProduct.id, catalogProduct.type);
            }
            return products;
        }
public static ApprienProduct [ ] FromIAPCatalog ( ProductCatalog catalog ) { var catalogProducts = catalog . allValidProducts ; var products = new ApprienProduct [ catalogProducts . Count ] ; var i = 0 ; foreach ( var catalogProduct in catalogProducts ) { products [ i ++ ] = new ApprienProduct ( catalogProduct . id , catalogProduct . type ) ; } return products ; }
Convert a Unity IAP Product Catalog into ApprienProduct objects ready for fetching Apprien prices.
Convert a Unity IAP Product Catalog into ApprienProduct objects ready for fetching Apprien prices .
/*
            // TODO: Get the store-specific products
            foreach (var product in catalogProducts)
            {
                Debug.Log(product.GetStoreID("GooglePlay"));
                Debug.Log(product.GetStoreID("AppleAppStore"));
            }
            */ // ICollection cannot be indexed with [i], foreach required
Returns an array of Apprien Products built from the given ProductCatalog object
Returns an array of Apprien Products built from the given ProductCatalog object
catalog
ProductCatalog
None