我创建了一个注册信标区域的应用程序,并使用CLLocationManager开始监视这些区域
CLLocationManager *manager = [[CLLocationManager alloc] init]; manager.delegate = self; CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:estimoteUUID major:12445 identifier:@"id"]; region.notifyEntryStateOnDisplay = YES; region.notifyOnEntry = YES; [manager startMonitoringForRegion:region];
当我从灯塔走得足够远并走回范围时,这种方法很有效.但是didEnterRegion
,如果我已经在信标区域的范围内启动应用程序,我也希望触发委托方法,而不仅仅是当我回到边界时.有没有一种简单的方法来实现这一目标?或者让CLLocationManager认为我们离开了信标范围的方法?
另一篇文章说设置region.notifyEntryStateOnDisplay = YES;
并按下保持按钮会这样做 - 但我没有这个工作(iOS 7.1,iPhone 5S).