Programmatically determine which application stores the application downloaded from

I did not find a thread about this, so I have to ask: is there a way to programmatically determine from which application store the application was downloaded? (e.g. German app store)

I do not want to request location permissions to determine the location of the user, but if there is no way to discover the application store, then I may need to.

+7
ios
source share
2 answers

I think you would use the current locale of the user to determine which country they are in ... but sometimes this may fail, so I'm not very sure if the effective way to detect AppStore will work 100% for you.

You need to call

[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode] 

Also, see the discussions in the following threads, some of them are old, but will probably help you find alternative solutions Link1 and Link2

+5
source share

If in the "Shopping" application you can check the priceLocale of your SKProduct , which gives you the store (currency and country)), the user is currently logged in.

Apple recommended this at WWDC2014 Session 303 Optimizing in-app purchases at 10:30.

+6
source share

All Articles