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
Barbara rodeker
source share