我需要对iBeacon技术的支持。在我们的例子中,我想要一个功能,无论我们的应用程序是在前台还是后台,都可以连续扫描(测距) iBeacons。我们知道使用CLLocationManager标准更新定位方法是可能的。但我们不想使用标准位置更新(因为我们不想冒电池耗尽的风险)。是否有其他选项可以在不使用CLLocationManager的情况下启动CLBeaconRegion的连续范围?
发布于 2014-12-24 14:27:22
我正在使用Estimote Beacons,有委托方法或Estimote(ESTBeaconManager类)可用"https://github.com/Estimote/iOS-SDK",每当信标进入范围或超出范围时,下面的委托方法将在内部调用,并帮助我们减少电池电量drain.We可以将接近检查放在didEnterRegion方法中:
- (void)beaconManager:(ESTBeaconManager *)manager didEnterRegion:(ESTBeaconRegion *)region{}
- (void)beaconManager:(ESTBeaconManager *)manager didExitRegion:(ESTBeaconRegion *)region{}
- (void)beaconConnectionDidSucceeded:(ESTBeacon*)beacon{}
- (void)beaconConnectionDidFail:(ESTBeacon*)beacon withError:(NSError*)error{}
- (void)beaconManager:(ESTBeaconManager *)manager  didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region{}发布于 2014-12-24 15:14:40
在iOS上检测iBeacon传输的唯一方法是使用CoreLocation,您是正确的,恒定测距确实会显著消耗电池。
理论上,您可以使用CoreBluetooth来检测其他信标类型,如AltBeacon (读取iBeacon广告详细信息被CoreBluetooth阻止),但电池使用量仍然是相似的。
在后台节省电池的标准方法是使用CoreLocation信标监控API,这对电池更容易。然后,当这些监控app检测到信标时,您可以开始测距,即使您的应用程序在后台。
有关延长后台测距时间的更多信息,请参阅此处:http://developer.radiusnetworks.com/2014/11/13/extending-background-ranging-on-ios.html
https://stackoverflow.com/questions/27632324
复制相似问题