locationManager:didEnterRegion not called when a beacon is detected

前端 未结 4 412
广开言路
广开言路 2020-12-03 03:45

While testing with beacons (iOS devices) I found the listener beacon giving some unexpected behavior. locationManager:didEnterRegion method is not getting c

4条回答
  •  攒了一身酷
    2020-12-03 04:14

    It's hard to say if I have seen the exact same thing without more specifics about the starting conditions of your test. But, yes, in some specific cases, I have seen locationManager:didRangeBeacons:inRegion get called even without getting a call to locationManager:didEnterRegion.

    If you start ranging and monitoring at the same time with the same region, and iOS thinks you were already in the monitored region, then you may not get a call to locationManager:didEnterRegion.

    To truly test if something is amiss, you need to set up a test case where you:

    1. Make sure you are not in the region.
    2. Let iOS run for several minutes
    3. Start monitoring that region
    4. Let iOS continue to run for a few minutes
    5. Enter the region.
    6. See if you get a call to locationManager:didEnterRegion

    If you still don't get a call after going through the above, then something is definitely wrong.

提交回复
热议问题