Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppStore In-App-Purchase: How to get the currency a user will pay in?

I have an iOS app 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 the items for purchase with the user's local currency, but I don't really know how.

Using the region or language of a user seems like a bad indicator, as the currency depends on the region of the AppStore account the user is using and not on the device settings.

How can I find out which currency a user will pay in?

like image 458
janpio Avatar asked Feb 22 '12 16:02

janpio


People also ask

Does in-app purchases mean you have to pay for it?

An in-app purchase is any fee an app may ask for. Many in-app purchases are optional or give users additional features. Others serve as subscriptions and require users to sign up and pay a fee to use the app – often after an initial free trial.

How do I know how much I paid for an app?

Check with your app store And that means they'll have records of any recurring payments. Reviewing these records lets you quickly see how much you've been paying and whether you should consider canceling any given subscription.


1 Answers

Once you have SKProduct object fetched you can construct its localized price from price and priceLocale properties. Here's copy-paste from apple docs how to do that:

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[numberFormatter setLocale:product.priceLocale];
NSString *formattedString = [numberFormatter stringFromNumber:product.price];
like image 59
Vladimir Avatar answered Dec 11 '22 07:12

Vladimir