iOS: App Store Sandbox Returning Wrong Currency for Test Users

1.9k views Asked by At

I have encountered a weird problem when testing my app in the iOS iTunes App Store Sandbox. I have two developer test accounts (set up via iTunes Connect) - one set to use the UK store, the other set to use the Ukrainian store.

When the app launches, it obtains the list of available IAP items via a SKProductsRequest. It then displays the item price using the following code (it has been implemented as a category of SKProduct, so 'self' refers to an SKProduct instance):

   NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease];
    [currencyFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
    [currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    [currencyFormatter setLocale:self.priceLocale];
    return [currencyFormatter stringFromNumber:self.price];

As far as I am aware, this is pretty much Apple's recommended code for this task. And when I use the UK store account to test my in-app purchases, everything works fine, with the price being displayed in pounds. However, when I use the Ukranian test account, the price is displayed in US dollars, rather than the Ukranian hyrvnia.

Looking into this a bit further, I tried printing out some of the priceLocale properties in the debug console, as follows:

NSLog(@"PriceLocale country Code: %@, localeIdentifier %@", , [self.priceLocale objectForKey:NSLocaleCountryCode], [self.priceLocale localeIdentifier]);

The output from which was:

PriceLocale country Code: UA, localIdentifier en_UA@currency=USD

Reading up on locale identifiers it appears that the @ symbol is used to modify the locale to override certain settings, in this case it would seem that the currency is being set to USD. The thing is, I can't work out why. Can anyone offer any advice on what the problem might be, or how I might look into it further?

1

There are 1 answers

1
Liam On BEST ANSWER

Your code is fine, however it's not currently possible to purchase items in the App Store in Ukrainian hryvnia. Ukraine's app store and many other countries operate in USD. See the link below for a full list of stores where USD is used.

App Stores where the US Dollar is the currency of sale