AppStore In-App-Purchase: how to get the currency that the user will pay?

I have an iOS application using In-App-Purchase that caters to an international audience, so I expect payments in different currencies (USD, EUR, CNY, ... you know them from the AppStore pricing matrix). Of course, I would like to show items for purchase in the user's local currency, but I really do not know how to do this.

The use of a region or language of the user seems to be a poor indicator, since the currency depends on the area of ​​the AppStore account that the user uses, and not on the device settings.

How can I find out in what currency the user will pay?

+8
app-store localization in-app-purchase
source share
1 answer

When you have an SKProduct, you can build its localized price at the price and prices. Here, copy-paste from apple docs how to do this:

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [numberFormatter setLocale:product.priceLocale]; NSString *formattedString = [numberFormatter stringFromNumber:product.price]; 
+31
source share

All Articles