1
votes

I download the project from here

https://www.raywenderlich.com/136165/core-location-geofencing-tutorial

and did little modification according to requirement

  1. xcode said description missing so I add these in info.plist

    Privacy - Location Always and When In Use Usage Description

    Privacy - Location When In Use Usage Description

  2. In GeotificationsViewController I modified this

    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { mapView.showsUserLocation = status == .authorizedAlways|| status == .authorizedWhenInUse }

When I grant authorizedAlways every thing works fine but when authorizedWhenInUse is granted its not delivering the didEnterRegion and didExitRegion

App is open, running, active, visible on screen in both scenarios.

xcode Version 9.2, iOS 11.2

1

1 Answers

2
votes

For region based monitoring operation you must be to gather authorizedAlways permission from user.

For more reference check this.

https://developer.apple.com/documentation/corelocation/cllocationmanager/1620562-requestwheninuseauthorization

Apps cannot use any services that automatically relaunch the app, such as region monitoring or the significant location change service.