What about cases where people live near and regularly cross borders? Or international travellers? Or that Hawaii is part of USA but 4,000 km distant? Or Falkland Islands?
Is the issue that you need to know, say, which side of the road people drive on, or whether they are north or south of the equator, or which continent they're on, or which laws apply in the current location, or what language is most common, or... ?
Exactly. Depending on the reason for this restriction, there are several more or less suitable options.
There are many differences to be aware of:
Perhaps there is code in the app that may not be available to users in some countries? What about tourists who may be legally allowed to use this code in that country, provided import and export regulations do not prevent it?
Or the software contains parts of code whose use is generally not permitted in this country?
From this point of view, you have to know exactly which method to use to achieve these restrictions.
There are several possibilities:
- Query the set language of the smartphone
- Query of the location via the location provider or GPS
- Query of the provider information, which also provides information about the country in which you are located.
- and not forgetting the possibility of perhaps only offering this app in certain countries via the Google Playstore.
All of them are more or less accurate, but it probably makes sense to use a combination of different methods.