tags:

views:

26

answers:

1

My iPhone application needs to provide different features in some local markets, so I need to be able to determine where the devices "home" market is or from which store it was downloaded (if applicable).

I've tried almost all variations of NSLocale but I always seem to be able to change one or more of the settings.

I need to disable one tab if they are not in the US/CA for legal reasons, and I'd prefer to keep just the single binary.

Does anyone know how to do this?

Thanks

A: 

You could get the country code using

NSString *countryCode = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];

But I'd imagine that data is quite easy to fake (it's dependent on the user's settings rather than where they actually live). It depends how secure your app needs to be - I would recommend uploading a separate binary for US/CA users if this is a major concern.

robinjam
Yes. That's what I've been trying and it's very easy for the user to change. I can't believe there's no way of determining this. I also can't believe that I'm the first to ask this:)And I'm trying to avoid the separate binary solution.
Bill