0

When my app is launched it requests to use location services.

If a user selects 'Don't Allow' I prompt again letting them know that Location Services are required for the best experience and they can enable in the settings app.

If a user does not allow and still creates an account, the main screen will not fully function without the location feature part.

From this point, if I manually enable in the Settings app I'm still not getting the main page to pick up the current location.

How do I detect that location services have been enabled from the Settings App?

Is there a method I need to enforce again from the AppDelegate?

Luke Irvin
  • 1,179
  • 1
  • 20
  • 39

2 Answers2

0

You can tell if location has been enabled for your app using CLLocationManager.AuthorizationStatus, which returns a member of the CLAuthorizationStatus enum. If location is disabled completely, your app won't be authorized, so you know everything you need to know.

let authorization = CLLocationManager.authorizationStatus()
if authorization == .AuthorizedWhenInUse || authorization == .Authorized {
    ...
}

If you request authorization using CLLocationManager and the user denies it, you can't cause the window to come up again.

From a UX point of view, be careful about nags as well. Communicate clearly that your app benefits from using location, but try to avoid browbeating the user about it.

Rikki Gibson
  • 4,136
  • 23
  • 34
0

See also how to determine when settings change on ios to have your app retry location access right after a user (hopefully) enabled it.

Community
  • 1
  • 1
Stefan L
  • 1,529
  • 13
  • 20