Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

startMonitoringForRegion is not calling didEnterRegion if the app is started within the region

I'm having an issue where my app will not fire the didEnterRegion event if I start the app within the region. If I start the app outside the region and then enter the region, it fires. If I start the app inside the region, then leave the region, then re-enter the region, it fires.

Any suggestions on how to get it to fire as soon as the app is opened if it's in the region would be much appreciated!

like image 514
Ben Wilkins Avatar asked Dec 12 '22 12:12

Ben Wilkins


1 Answers

I suggest you to use this code

[locationManager requestStateForRegion:region];

And use the delegate method didDetermineState: to check if the state is CLRegionStateInside or CLRegionStateOutside.

like image 160
Phan Lac Phuc Avatar answered Dec 25 '22 23:12

Phan Lac Phuc