Monitoring several regions of the lighthouse does not work, but the developers said that this is possible? Thoughts? (See My Code)

Here is my code:

    // 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];
    }

To clarify, "_ serviceUUIDs" is an NSArray of NSStrings containing five UUIDs. I use Locate iBeacons for testing and find that the last region to be added is the only one found. It also seems to be controlled by only one. I determined this by setting "_ locationManager.monitoredRegions" .

There are several streams here that say that you can control several areas of the lighthouse. Does anyone have thoughts on why it doesn't work for me? Thanks!

+4
1

, identifier. , SERVICE_IDENTIFIER . .

+13

Source: https://habr.com/ru/post/1523417/


All Articles