[Solved] How to add products after inititalization

Hi,

In Unity IAP, I need to add products after the initialization. I think I need to use FetchAdditionalProducts. Is that correct? Does anyone have an example?

Thanks!

You add the products before initializing the IAP.
builder.AddProduct(“product_id”,ProductType.NonConsumable);

In my applications, products can get added at any time, so there’s a possibility that new products can appear while users are playing and therefore would need to be added after the IAP initialization. In other words, the application doesn’t know all the products during initialization.

I think I solved this…

public void IntializeNewProduct (string productId) {
HashSet itemsHashSet = new HashSet();
itemsHashSet.Add(new ProductDefinition(productId, ProductType.NonConsumable));
m_StoreController.FetchAdditionalProducts(itemsHashSet, OnProductsFetched, OnInitializeFailed);
}