While testing with beacons (iOS devices) I found the listener beacon giving some unexpected behavior. locationManager:didEnterRegion method is not getting called even if a beacon enters a region. But the locationManager:didRangeBeacons:inRegion: is getting called correctly, and detected beacons are shown there. Has anyone experienced anything like this.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
(and do follow the instructions given by Mr. Davidgyoung. believe me, it will definitely work.)
Check if your methods are implemented in the following way. In
viewDidLoad
, start moniotoring at the endafter monitoring start, request state for your defined region
after state is determined, start ranging beacons
and implement the following methods according to your needs...
Hope this will solve your problem.
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:
If you still don't get a call after going through the above, then something is definitely wrong.
You also need to be aware that you are monitoring a region - not a particular beacons.
So if you have 3 beacons which share the same
proximityUUID
and your region is defined as onlyproximityUUID
(without major and minor values) you will get notified only in two situations:No beacons from the region were in range and first beacon/beacons gets discovered (
didEnterRegion:
)One or more beacons from the region were in range and they all went out of sight for ~30 seconds (
didExitRegion:
)