小编Her*_*Rod的帖子

CLLocationManager didEnterRegion:在应用程序暂停时使用iBeacon

我正在尝试唤醒我的应用程序(重新启动它),当它进入我定义的信标区域但我无法让它工作.这是我正在使用的步骤和代码.

  1. 将"位置更新"背景模式设置为YES.
  2. 监控我的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];
    
    Run Code Online (Sandbox Code Playgroud)
  3. 实现委托方法

    - (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region;
    - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region;
    - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region;
    
    Run Code Online (Sandbox Code Playgroud)

我可能遗失的任何东西?我已阅读文档,博客文章,论坛,似乎没有任何工作.是我读过的网站之一,是另一个.

objective-c core-location ios bluetooth-lowenergy ibeacon

3
推荐指数
1
解决办法
2661
查看次数

手机重启后 iBeacon 监控/测距

重新启动手机后,我的应用停止获取 CoreLocation 委托回调,这是预期行为吗?我想我记得读过你仍然可以获得回调。如果是这样,文档中是否有任何地方说它是否可能?

core-location ios ibeacon

1
推荐指数
1
解决办法
933
查看次数