views:

549

answers:

2

I have a feature in my iPhone application that, for business reasons, should only be shown/available to customers in the US. If I want to release this app to App Stores outside the US, what's the best way to figure out which country I'm in without relying on user-defined settings such as language and locale?

In my mind, the ideal solution is that there's some runtime property that can tell me which App Store country the app was downloaded from, and I can take action accordingly. Looking through the docs and searching the web, I'm not coming up with anything in this department.

I don't expect the solution to be 100% foolproof as far as users not being in the country they say they're from, but as close as possible would be nice.

I suppose one solution would be to make a separate build for a new product on the App Store and have two versions, one for the US and one for the others, but that doesn't seem ideal. I'm hoping it can be the same product on the App Store to prevent things like fragmentation of user reviews.

Thanks in advance!

A: 

It's either Locale, or different versions for different stores.

To me the Locale option seems like the least amount of work and will probably be correct 95% of the time...

Kendall Helmstetter Gelner
A: 

You can retrieve the email address of the account used to purchase your app by reading from the iTunesMetadata.plist inside your application's root folder (the parent of the folder that contains your app's Info.plist and icon.png). Because each application is tied to a single iTunes store region, you could in theory use that to determine the region the application was purchased from.

I wouldn't recommend it though.

rpetrich
Not seeing how you connect email address to an iTunes store region... can you clarify?
Mike McMaster