1

How to ask the user to turn ON location if the device location is turned off in .net maui. On certain apps, a pop up appears to ask the user to turn on location services. Similar kind of functionality, I want for .net maui application. Every time location is turned off, opening the app should ask the user to turn it on.

It's not about the permission. It's about the device's current location services settings, whether it's turned on or off.

Arup
  • 155
  • 11
  • Does this answer your question? [How to check if the location service is "on" in Xamarin Forms?](https://stackoverflow.com/questions/69139559/how-to-check-if-the-location-service-is-on-in-xamarin-forms) Although that is for Xamarin, the same code should work. – ToolmakerSteve Nov 25 '22 at 05:11

1 Answers1

-2

You can check if the location is ON with following

if (strLocation == "Location services are not enabled on device.") { enter alert here }

here strLocation is the variable which gets location data from location service

Vinay Kulkarni
  • 81
  • 1
  • 10