Create your catalog programmatically
Use the CatalogProvider class to define your catalog in code for flexible or runtime-driven configurations.
Read time 1 minuteLast updated 18 hours ago
You can define your catalog directly in code using the
CatalogProvider
To define catalog listings programmatically:
- During the initialization stage, create an instance of the class.
CatalogProvider - Use the method to add each listing, or
AddProduct()to add multiple listings at once.AddProducts() - For each listing, specify a unique cross-store and
Product ID.Product Type
100_gold_coinsCatalogProviderFetchProducts()using UnityEngine;using UnityEngine.Purchasing;public class MyIAPManager { public MyIAPManager () { var catalog = new CatalogProvider(); catalog.AddProduct("100_gold_coins", ProductType.Consumable); // Connect to the store catalog.FetchProducts(UnityIAPServices.DefaultProduct().FetchProductsWithNoRetries); }}