I have a store in my game where users can buy things. Currently everything is hardcoded (ie. $1.99)
I’d like to switch it to use their localized currency and have the game display the price appropriate to where they live (ie. In Canada, the price might be $1.99 CAD, and in the US the price for the same item might be $1.49 US)
From what I have read, it looks like all this information can be pulled from the purchasing apis.
In one tutorial I was reading, it showed once the UnityPurchasing had been initialized, I can get the metadata for each shop item with the following code :
public void OnInitialized(IStoreController controller, IExtensionProvider extensions) {
foreach (var product in controller.products.all) {
Debug.Log (product.metadata.localizedTitle);
Debug.Log (product.metadata.localizedDescription);
Debug.Log (product.metadata.localizedPriceString);
}
}
This appears to work… well, sort of. It does log out products and their prices… but does not appear to be loading the prices from what I set in the Google Play Console (where I defined the in app purchase items)… it appears to be grabbing whatever was set in a file I found in /resources/IAPProductCatalog.json
(I think was auto generated at some point… not sure where it came from)
I assume it should be loading the pricing info from google and not this random config file? (not sure if I can delete it)
Any idea what I am missing?
Thanks!!