Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios iBeacon Bluetooth didEnterRegion和didExitRegion方法从不激发_Ios_Objective C_Bluetooth_Cllocationmanager_Ibeacon - Fatal编程技术网

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如下:
  • 在项目信息或info.plist中--> 自定义IOS目标属性--> . 添加“所需背景模式” . 在此对话框中添加两项--> “应用程序使用CoreBluetooth共享数据” “应用程序注册位置更新”
  • 项目内能力--> 有背景模式
    . 选中“动作更新”
    . 选中“充当蓝牙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方法。