IOS Get the country the device user is in
Developed an iOS application. One of the requirements we have is to force the user's location country to enforce restrictions in the app. One solution was to collect the IP address and use it with a geolocation service to get the country. One of the partners told us that such a decision violates Apple's rules. Can anyone confirm this expression? Or does someone know another way to collect only the country where the device user is located?
source to share
Use Apple-provided location services to find a user's location. It is much more accurate than geocoding from IP addresses, it does not require a third party service (or your own service), and it provides an approximate latitude and longitude for the user that you can use on a map or similar.
source to share
Using location services provided by Apple is only part of the solution. Since location services do not return a country, you will need to use a service that accepts latitude and longitude to determine nearby countries. I've used this before for other purposes, but a request for something like this web service with latitude and longitude should return you a country nearby.
source to share
You can use the Google Reverse Geocoding API to get the country name based on the coordinates of the user's location
source to share