Region monitoring current location doesn't notify on exit

前端 未结 2 2064
梦谈多话
梦谈多话 2021-02-04 10:15

I\'m trying to test region monitoring, for that I\'m getting current location like this:

- (void)startLocationTracking
{
    CLLocationManager *locationManager =         


        
2条回答
  •  借酒劲吻你
    2021-02-04 10:59

    The most satisfactory answer to the delegates methods (didEnterRegion and didExitRegion) not being called is, apple docs says you will be notified after 3 to 5 minutes after the entry or exit, but in actual testing what I found is you have to wait for approx 7 to 8 minutes.

    I tested it for 10 to 15 times and my region radius was around 80 meters. I was scratching my head to see what went wrong. I left the simulator open with the location tracking on (Used a gpx file for location simulation). After 8 minutes didExitRegion was called.

    Also if you want to do this in background, you must enable background modes on your target. enter image description here

提交回复
热议问题