Is there a way to programmatically find out what country a user's phone is from when my app is opened on their phone?
I have an app I'm developing that can use lbs/kg units and if someone's phone is from the United States, I want to enable lbs by default and if the phone is from anywhere else, I want to display kg by default. (note that I don't need think checking where they are connecting from would be accurate because it could be that they are travelling or using another country's proxy server).
You can't get the country, but you should be able to guess it from:
Personally, I wouldn't worry about the travelling scenario - travelling Americans purchasing your app represents a very small percentage of your downloads.
You could also use the GPS to get their current position, then use the Bing API to get the country from the lat/long.
Using the GPS involves it's own headaches like adding a Privacy Policy, but from Stuart's answer, it seems like the most accurate way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With