I have a problem with handling Geofence
and user current location at the same time.
When app starts working, didUpdateLocations
called perfectly and I have the user location as desired.
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
But as soon as the didEnterRegion
delegate being called,
func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {}
the didUpdateLocations
will not fire anymore.
are they related together?
I also checked the
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {}
the status not changed after didEnterRegion
gets called.
I also added the
locationManager?.startUpdatingLocation()
in didEnterRegion
but still the didUpdateLocations
not gets called.
does anyone know where the problem is? How to track the location in the regions?
PS: updating location automatically stopped when EnterRegion is being called and automatically start when ExitRegion is being called
Update: I use xCode9, iOS 10, swift 4. both the EnterRegion
and ExitRegion
are empty and I just print a log in them now, they're going to post some data to the server in the future.