iBeacon蓝牙didEnterRegion和didExitRegion方法永远不会被触发

非常奇怪的是,在didEnterRegion didExitRegion之后, didEnterRegiondidExitRegion永远不会被触发。 另外, didDetermineState可以按期望触发。

在现阶段,我只根据苹果示例代码演示Airlocated评估iBeacon技术。

因此,我只实现了两个方法,包括文件APLAppDelegate.m中的didEnterRegiondidExitRegion ,如下所示:

 - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Entered region: %@", region); [self sendLocalNotificationForBeaconRegion:(CLBeaconRegion *)region]; } - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { NSLog(@"Exited region: %@", region); } 

波纹pipe的步骤已经尝试过,但没有效果。

  • 使用iOS7.1重置iPhone5 / iPhone4s
  • 将背景模式和* .plistconfiguration为如下forms:
  1. 在项目信息或info.plist – >自定义IOS目标属性 – >。 添加“所需的背景模式”。 在这添加两个项目 – >“应用程序共享数据使用CoreBluetooth”。“应用程序注册的位置更新”
  2. 在项目能力 – >有背景模式
    。 检查“Loaction更新”
    。 检查“用作蓝牙LE配件”。 选中“使用蓝牙LE配件”
  • 授权应用程序访问设备位置。

那么有谁能给我一些build议呢?

提前致谢。

startMonitoringForRegion之后添加startRangingBeaconsInRegion方法,然后重试

[_locationManager startRangingBeaconsInRegion:demoRegion]; // demoRegion – 您创build的区域