I am implementing IAP in an iPhone app and am working in the sandbox environment. I have my code setup to process SKProducts
returned by an SKProductsRequest
to get pricing information. I would like to test retrieving price values in different locales (e.g. Euros or Yen) to test my formatting code. How can I get SKProductsRequest
to return different locales?
Asked
Active
Viewed 2,737 times
7

atxe
- 5,029
- 2
- 36
- 50

Josh Knauer
- 1,744
- 2
- 17
- 29
-
Possible duplicate of [Testing localized in-app purchases](https://stackoverflow.com/questions/37638117/testing-localized-in-app-purchases) – Amos Sep 20 '18 at 05:51
2 Answers
4
Answering my own question here. You can test this by creating IAP test users in different stores on iTunes connect.

Josh Knauer
- 1,744
- 2
- 17
- 29
-
2To be specific: you can't sign in with any Test user in the Settings app, which means that the first time you run the app you're testing you're going to get your home pricing. But if you buy something and enter a "foreign" apple ID, then reload your product data from StoreKit, then you'll get the foreign prices shown. – c roald Sep 19 '12 at 22:13
-
1@croald What does "home pricing" mean? I'm trying to figure out why StoreKit is returning the (invalid) locale "en_SE" when trying to get product info the first time on the simulator. My regional settings are set to US. What is the "home price" based upon? – Kristofer Sommestad Apr 15 '13 at 09:45
0
We get the product price based on the user's registered iTunes connect account locale.
You can only get different locales manually by using NSNumberFormatter as described in SkProduct class reference here
-
If I were to login to a different iTunes store (Japan for example) on my device and run an SKProductsRequest while my app is still in the IAP sandbox would I see a different price locale? Or are you saying there is no way to test this before going live? (Obviously I can and have unit tested my conversion code, I'd just like to test it against the real live system too) – Josh Knauer May 19 '11 at 12:46
-
Your iTunes connect account, with the help of which you download/buy apps from apple store, must have some locale. You get the locale from SkProductsRequest based on this locale. You can always change your country (locale) of your iTunes connect account. – May 19 '11 at 15:26