# 怎样才能同时检测多个iBeacon的进入或退出

**URL:** <https://bbs.aprbrother.com/t/ibeacon/131>\
**Category:** AprilBeacon\
**Created:** [June 1, 2015, 4:33am UTC](https://bbs.aprbrother.com/t/ibeacon/131 "2015-06-01T04:33:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiamao130](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jiamao130](https://bbs.aprbrother.com/u/jiamao130)\
**Post date:** [June 1, 2015, 4:33am UTC](https://bbs.aprbrother.com/t/ibeacon/131/1 "2015-06-01T04:33:37Z")

</div>

目前针对单一的iBeacon设备能检测进入或退出并且进行通知推送，但如何能同时检测多个iBeacon的进入或退出，并能准确响应相应的iBeacon通知，可以通过进入或退出的时间进行检测，但多个iBeacon的话，每个iBeacon都设置进入或退出时间吗？例如在商场中，每层都有好多iBeacon，这个该如何进行准确通知？

---

<div class="post-metadata">

**Author:** ![markss](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/markss/32/17_2.png) [@markss](https://bbs.aprbrother.com/u/markss)\
**Post date:** [June 1, 2015, 5:31am UTC](https://bbs.aprbrother.com/t/ibeacon/131/2 "2015-06-01T05:31:01Z")

</div>

进入和退出是针对是的 CLBeaconRegion，如果想检测多个beacon进入和退出，那么就要把每一个beacon都作为一个region进行 startMonitoringForRegion。一般情况下，涉及到多个beacon时候，去通过startRangingBeaconsInRegion得到beacon的数量，然后自己根据beacon返回的距离去实现。
