I track the user's location and ask for permission when my load first loads using this:
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()
If the user denies, but later changes their mind by enabling the configuration option in my app, how do I ask again? For example, I have a switch for auto detecting the user's location so when they enable it, I am trying to do this:
@IBAction func gpsChanged(sender: UISwitch) {
// Request permission for auto geolocation if applicable
if sender.on {
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()
}
}
But this code doesn't seem to do anything. I was hoping it would ask the user again if they want to allow the app to track the user's location. Is this possible?