Reputation: 11
Since I installed Xcode 12 I have found that my IAP's are only showing prices in USD instead of in GBP as per my device's settings. Apps built on Xcode 11 and before show the price in GBP correctly on my device whilst anything I build on Xcode 12 is showing in USD only. The code that shows the price is:
let firstProduct = response.products[0] as SKProduct // there is only 1
// Get its price from iTunes Connect
let numberFormatter = NumberFormatter()
numberFormatter.numberStyle = .currency
numberFormatter.locale = firstProduct.priceLocale
self.priceField.text = numberFormatter.string(from: firstProduct.price)
Where priceField is just a UILabel on the screen. The value of priceField.text is always showing as $4.99 since Xcode 12. The device being used is a UK iPhone 8, UK English language and UK store settings. If I download the currently published version of the app from the store then it shows correctly as £4.99. Debugging firstProduct.priceLocale.regionCode in Xcode 12 returns "US".
I cannot find any setting in Xcode to set/override the region so I am at a loss as to where it is getting this from. Perhaps something has changed that I cannot find in the documentation?
Thanks in advance!
Upvotes: 1
Views: 1245
Reputation: 11
On iOS 14 or 14.0.1 the problem is not resolved even with Testflight.
So it might also be related to iOS 14 as well.
Xcode 12, 12.0.1 shows correct currency on a device with iOS 13 or prior.
See this link: https://developer.apple.com/forums/thread/660817
Edit: I installed my app through TestFlight. At first it again displayed in USD. But when I pressed resolve option it asked for Apple ID credentials (although I had signed in through settings) and then displayed in correct currency. The problem seems solved somehow. Thanks .
Upvotes: 1
Reputation: 11
Yes, Paulw11 is correct, the TestFlight/release versions do not suffer from this problem. I assume this is just a bug in Xcode/IAP which is defaulting to US.
Upvotes: 0