【发布时间】:2014-07-30 18:33:47
【问题描述】:
我制作了一个应用程序,它注册信标区域并开始使用 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)。
【问题讨论】:
标签: ios cllocationmanager ibeacon estimote