Tuesday, 13 August 2019

iphone - How to prompt user to turn on Location Services...again

I want to have the same functionality as the Map app, where user is prompted every time they press the 'current location' button to turn on their Location Services if they are off:




  • Turn off location services

  • User presses 'getCurrentLocation' button

  • App tries to get location using CLLocationManager

  • User gets 'Turn On Location Services..." message that shows "Settings" and "Cancel" buttons.

  • User taps 'Cancel'

  • User presses ''getCurrentLocation' button again

  • App tries to get location using CLLocationManager again

  • User does not get 'Turn On Location Services..." message any more



In the Map app, the user gets "Turn On Location Services..." message every time. How can I get my app to do the same? I made user I am using a new instance of CLLocationManager, in case that was the problem, but it was not. I can't see any settings that would affect this.



If I make my own Alert I cannot get the same 'Settings' button functionality. Also, I don't want the user to see multiple Alerts that look the same.



Any ideas?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...