I have an app that is ranging beacons in the background. When I initialize my CLLocationManager instance I'm starting things off with the startMonitoringForRegion
method. I am handling the locationManager:didEnterRegion
, locationManager:didExitRegion
, and locationManager:didDetermineState:ForRegion
delegate methods. Within those methods I am turning ranging on/off.
This all seems to work great except when the CLLocationManager
is initialized when the user is already present within the region. In that case neither locationManager:didEnterRegion
nor locationManager:DidDetermineState:ForRegion
are called until after I exit and then re-enter the region. I was always under the impression that this would at least trigger locationManager:DidDetermineState:ForRegion
but that does not appear to be the case.
Is there a way to determine if the user is initially within the region when I first fire off startMonitoringForRegion
?
You can invoke the manager's requestStateForRegion
method. This will cause your delegate's didDetermineState
method to be called asynchronously.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With