Page 1 of 1

Fetching localized price to display for in-app purchase

Posted: Thu Mar 05, 2015 1:37 am
by Coffee1633
Hi

I successfully created my in-app purchase store and tested a non-consumable product. No problems.
What I can't figure out is how to fetch and display a localized price. All I can do is hard code the price in some default currency like US dollars and let users figure out the conversion themselves. Is there a way to get the local currency for products to display and only if that fetch fails, say because no connection, only then would I display a default currency.
Is that possible?

Bob
-------------------
Update

I think I figured it out.
I will post my solution after I test it.
Sorry.

solution
I didn't test it yet but it looks like it is necessary to use the following two handlers:
Use the mobileStoreRequestProductDetails command to request information about a specific product from the store.
mobileStoreRequestProductDetails "com.runrev.sampleapp.consumable"
which generates a the following message

on productDetailsReceived pProdID, pDetails
answer "Querying details for product : " && pProdID
if pDetails is empty then
--no product by that id
else
--returns: details - Is an array that contains information about the specified product. The keys of this array may differ, depending on the store. see dictionary. and one of the array keys is "price".
end if
end productDetailsReceived