I realized today that although I have my own name & descriptions defined in my metadata, when a purchase is made, the system purchase dialog shows the name & descriptions as defined in the respective app store setups for iOS and Android. I hadn’t updated the app store names to match my metadata, so there was a visual discrepency.
I assumed that the IAP library would have a way to read the name & description of the products after intialization succeeded, but I can’t seem to find a way to do it. It makes sense to display the data as defined in the stores instead of using my own metadata to avoid future discrepencies. Is this possible?
You can simply update your own app with the correct values. Otherwise, you can use the product object. From the Sample IAP Project here https://discussions.unity.com/t/700293/4
public void ListProducts()
{
foreach (UnityEngine.Purchasing.Product item in m_StoreController.products.all)
{
if (item.receipt != null)
{
MyDebug("Receipt found for Product = " + item.definition.id.ToString());
}
}
}
Thanks, I’ll give those a try. If id is actually the name, then that’s a serious misnomer for that property name. Id is a different thing than name when defining products.
Apple store definition uses “Product ID” and “Display Name”: Google Play store definition uses “Product name” and “Product ID”.
@Gillissie Unity IAP uses the productID, same as on your dashboard, to identify you product and not relevant to the discussion here. As we seem to be going off topic, I will go ahead and close this thread. I generally use ID to refer to the product name in general across stores. In summary, to get the dashboard ID, you use the product.definition.id property. To get the Name, you would retrieve the localizedTitle property. And the Description is the localizedDescription.