daniloslv
daniloslv

Reputation: 23

App with different functionality based on the user's country

I need to develop an application that will behave differently depending on the user's country. Let's say, if the user is in France, some functionality would be available. But, if the user were from India, he would be able to acces a different set of functionality.

If it were only language based restrictions, I could switch functionality using NSLocale class methods. But my functionality is really dependent on the user's country because of licensing and legal reasons.

What are the best practices for dealing with this situation?

Upvotes: 2

Views: 684

Answers (2)

Clafou
Clafou

Reputation: 15410

For each market where you have specific requirements due to market-specific licensing or legal issues, you can create a separate app in iTunes Connect and make it available for download only in the relevant market. And if you need to, this also allows you to provide a market-specific EULA. It's a big maintenance burden, but it would ensure that only users in a given market can access the app.

Note that in XCode you can fairly easily build, deploy and publish multiple versions of your project built from different configurations (XCode calls this "Targets"), so you could still achieve this in a single codebase by simply adding some preprocessor definitions in the relevant target definitions and putting #ifdef in your code where you want differentiated logic.

Upvotes: 2

rmaddy
rmaddy

Reputation: 318955

A 3rd party app has no access whatsoever to any information about the user of the device or access to the iTunes account. There is no way to know the user's true country. At any given time, the device may not even be associated with any one person. An iPod touch, for example, may have no user logged into any iTunes account. The same device can ultimately be logged into one of several different accounts.

All you have access to is the user's current GPS location (if the user allows your app to access that information) or their current locale.

Basically, there is no way to do what you need. Of course you could prompt the user but obviously there is no way to verify this information.

Upvotes: 1

Related Questions