Am I understanding Region Info correctly?

So I don't necessarily need geocoding permissions, I don't care what the users city or location is, I just want to get the users country, or even continent. I found this guy in Xamarin documentation

System.Globalization.RegionInfo

Which when I test and access System.Globalization.RegionInfo.CurrentRegion.Name I get back US, Which I am in the United States, so that works. But I am beginning to question whether or not this is doing what I think it is. Является RegionInfo something I can access to get a users location? The reason I am questioning this is, when I ran my app on iOS simulator on Mac (windows (Xamarin iOS Windows Simulator, not Windows OS) doesn't let you do a custom location for some reason), I had changed the lat/long values to be in Australia. But my value was still US, I can chalk that up to being a simulator, perhaps that RegionInfo uses some other process and doesn't get affected by the custom lat/long values on simulator. I just want to make sure this is doing what I think it is.

1 ответ

Решение

RegionInfo - это настраиваемое пользователем значение - смотрите Настройки -> Общие -> Язык и регион.

Если вы хотите узнать физическое местоположение пользователя, вы можете

1. use GPS
2. ask them
3. try IP geolocation
Другие вопросы по тегам