【发布时间】:2014-02-03 03:51:41
【问题描述】:
当我的应用程序进入我定义的信标区域时,我正试图唤醒它(重新启动它),但我无法让它工作。这是我正在使用的步骤和代码。
- 将“位置更新”后台模式设置为“是”。
-
监控我的 CLBeaconRegion
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"EBEFD083-70A2-47C8-9837-E7B5634DF524"]; beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"daRegion"]; beaconRegion.notifyEntryStateOnDisplay = NO; beaconRegion.notifyOnEntry = YES; beaconRegion.notifyOnExit = YES; self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; [self.locationManager startMonitoringForRegion:beaconRegion]; -
实现委托方法
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region; - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region; - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region;
我可能遗漏了什么?我已经阅读了文档、博客文章、论坛,但似乎没有任何效果。 This 是我阅读的网站之一,this 是另一个。
【问题讨论】:
-
您的应用是否检测到前台的信标?
-
是的,即使在后台,当应用程序被杀死时我也无法让它工作。
标签: ios objective-c core-location bluetooth-lowenergy ibeacon