Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically detect which app store the app was downloaded from

Tags:

ios

I haven't found a thread about this so I must ask: is there a way to programmatically detect which app store the app was downloaded from? (ie: Germany App Store)

I don't want to have to ask for location privileges to detect user location but if there isn't a way to detect the app store then I may have to.

like image 772
Silverstar Avatar asked Apr 24 '14 20:04

Silverstar


People also ask

How do I track downloaded apps?

On your Android phone, open the Google Play store app and tap the menu button (three lines). In the menu, tap My apps & games to see a list of apps currently installed on your device. Tap All to see a list of all apps you've downloaded on any device using your Google account.

How do I find an App Store developer?

Finding developers People can search for developers directly on the App Store. Tapping a developer's name within search results leads to the developer's page, which highlights their latest release above their entire collection of apps and games.


2 Answers

If you have In App Purchases you can check the priceLocale of your SKProduct, which gives you the store (currency and country) the user currently is logged in.

Apple recommended this at WWDC2014 Session 303 Optimizing In-App Purchases at 10:30.

like image 162
JeanLuc Avatar answered Nov 15 '22 20:11

JeanLuc


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

You'd need to call

[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]

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

like image 30
Barbara R Avatar answered Nov 15 '22 19:11

Barbara R