I am implementing in-app purchases for an app with support for several countries.
The In-App Billing Version 3 API claims that:
No currency conversion or formatting is necessary: prices are reported in the user's currency and formatted according to their locale.
This is actually true, since skuGetDetails()
takes care of all necessary formatting. The response includes a field called price
, which contains the
Formatted price of the item, including its currency sign. The price does not include tax.
However, I need the ISO 4217 currency code (retrievable if I know the store locale) and the actual non-formatted price (optimally in a float or decimal variable) so I can do further processing and analysis myself.
Parsing the return of skuGetDetails()
is not a reliable idea, because many countries share the same currency symbols.
How can I get the ISO 4217 currency code and non-formatted price of an in-app purchase with the In-App Billing Version 3 API?
SKProduct.priceLocale
, which you can then use to get the currency code withobjectForKey:NSLocaleCurrencyCode
. – Undemonstrative