iBeacon在后台模式下访问

时间:2014-08-20 06:59:42

标签: ios ibeacon ibeacon-android

我正在访问Gelo iBeacon,它在前台模式下工作正常,但是当应用程序处于后台模式时如何获取ibeacon范围或区域监控。

提前致谢

3 个答案:

答案 0 :(得分:1)

通常iOS可让您在后台监控beacons,但不能监控它们的范围。在监视事件发生后,测距只能在后台运行几秒钟。

有关设置后台监控所需的检测时间和步骤的详细信息为here.

答案 1 :(得分:0)

使用以下方法,它将适用于背景和背景

- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region

答案 2 :(得分:0)

您需要确保始终要求访问位置管理员。

if ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)])
{
    [self.locationManager requestAlwaysAuthorization];
}

请勿使用"位置更新"或"使用蓝牙LE配件"因为这可能会导致应用商店拒绝。我们没有使用测距,只是监控,这对我们来说很好。

相关问题