# iOS AprilBeacon如何支持后台定位？

**URL:** <https://bbs.aprbrother.com/t/ios-aprilbeacon/613>\
**Category:** AprilBeacon\
**Created:** [June 23, 2016, 10:17am UTC](https://bbs.aprbrother.com/t/ios-aprilbeacon/613 "2016-06-23T10:17:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ios\_bluetooth](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/i/dbc845/32.png) [@ios\_bluetooth](https://bbs.aprbrother.com/u/ios_bluetooth)\
**Post date:** [June 23, 2016, 10:17am UTC](https://bbs.aprbrother.com/t/ios-aprilbeacon/613/1 "2016-06-23T10:17:06Z")

</div>

我在app进入后台后调用了[\_beaconManager startMonitoringForRegion:beaconRegion];  
Background Modes → t Location updates and Acts as a Bluetooth LE Accessories 都设置了  
但是- (void)beaconManager:(ABBeaconManager \*)manager didRangeBeacons:(NSArray \*)beacons inRegion:(ABBeaconRegion \*)region代理方法没有执行

---

<div class="post-metadata">

**Author:** ![Rose](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/rose/32/12_2.png) [@Rose](https://bbs.aprbrother.com/u/Rose)\
**Post date:** [June 24, 2016, 7:56am UTC](https://bbs.aprbrother.com/t/ios-aprilbeacon/613/2 "2016-06-24T07:56:23Z")

</div>

startMonitoringForRegion:beaconRegion 方法的回掉方法不是didRangeBeacons，而是didEnterRegion 和didExitRegion，并且这两个方法要写在第一个VC或者首次启动App会创建的对象中，否则收不到回掉
