Ios iBeacon Bluetooth didEnterRegion和didExitRegion方法从不激发
非常奇怪的是,Ios iBeacon Bluetooth didEnterRegion和didExitRegion方法从不激发,ios,objective-c,bluetooth,cllocationmanager,ibeacon,Ios,Objective C,Bluetooth,Cllocationmanager,Ibeacon,非常奇怪的是,startMonitoringForRegion被调用后,didEnterRegion和didextregion从未被激发。此外,didDetermingEstate可以按预期触发 在当前阶段,我仅根据以下内容评估iBeacon技术 因此,我只在文件APLAppDelegate.m中实现了两种方法,包括didEnterRegion和didextregion,如下所示: - (void)locationManager:(CLLocationManager *)manager didE
startMonitoringForRegion
被调用后,didEnterRegion
和didextregion
从未被激发。此外,didDetermingEstate
可以按预期触发
在当前阶段,我仅根据以下内容评估iBeacon技术
因此,我只在文件APLAppDelegate.m
中实现了两种方法,包括didEnterRegion
和didextregion
,如下所示:
- (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);
}
以下步骤已经尝试过,但没有效果
- 使用iOS7.1重置iPhone5/iPhone4s
- 配置后台模式和*.plist如下:
. 选中“动作更新”
. 选中“充当蓝牙LE附件” . 勾选“使用蓝牙LE附件”
- 授权应用程序访问设备位置李>
提前感谢。在
开始监视区域
之后添加开始Trangbeaconregion
方法,然后重试
[\u locationManager StarTrangBeaconRegion:demoRegion]代码>//demoRegion—您已创建的区域尝试添加区域。notifyOnEntry=YES;region.notifyOnExit=是;创建CLBeaconRegion.region后,感谢您的及时反馈,它将在尝试后立即更新状态。Greg,在指定参数为“region.notifyOnEntry=YES;region.notifyOnExit=YES”后似乎没有效果。谢谢,Greg。这是我第一次提出问题,而你是第一个在stackoverflow.com上给我回复的人我该离开办公室了。贝伊,亚历克斯,谢谢你的建议。我会在尝试后添加结果。顺便说一句,测距API在之前的验证中工作正常。哇!!!!!!!!!!监控API按照您的建议正常工作。非常感谢大家你为什么知道这个?????我已经看到了您在苹果帮助文档中指出的相关描述??是的,刚刚在David G.Young的注释中解释了为什么在StartMonitoring for Region之后添加StartTrangBeaconsisten方法。