监控多个信标区域不起作用,开发人员已经说过可能吗?思考?(见我的代码)

 好几个健康2002_408 发布于 2023-01-31 17:53

这是我的代码:

    // Initialize and monitor regions
    for (NSString *serviceUUID in _serviceUUIDs) {
        // Initialize region
        NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:serviceUUID];
        CLBeaconRegion *appBeaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:SERVICE_IDENTIFIER];
        // Specify notifications
        appBeaconRegion.notifyEntryStateOnDisplay = YES;
        appBeaconRegion.notifyOnEntry = YES;
        appBeaconRegion.notifyOnExit = YES;
        // Add to regions
        [_appBeaconRegions addObject:appBeaconRegion];
        // Begin monitoring region and ranging beacons
        [_locationManager startMonitoringForRegion:appBeaconRegion];
        [_locationManager startRangingBeaconsInRegion:appBeaconRegion];
    }

为了澄清," _ serviceUUIDs"是NSStrings的NSArray,包含五个UUID.我正在使用Locate iBeacons进行测试,并发现要添加的最后一个区域是唯一被检测到的区域.它似乎也是唯一被监控的人.我通过检查"_locationManager.monitoredRegions"来确定这一点.

这里有许多线程说可以监控多个信标区域.有谁想过为什么它不适合我?谢谢!

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有