Detect at runtime which country's App Store my iPhone app was downloaded from?

Posted by Mike McMaster on Stack Overflow See other posts from Stack Overflow or by Mike McMaster
Published on 2009-07-10T21:21:11Z Indexed on 2010/05/29 9:02 UTC
Read the original article Hit count: 170

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!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about localization