1
여러 개의 iBeacons를 감지하려고합니다. 나는 그들 옆에 3 개의 iBeacons를 놓았다.didRangeBeacons는 한 번에 하나의 iBeacons 만 반환합니다.
하나씩 감지하는 데 문제가 있습니다. 배열에 없습니다. 3 개의 iBeacons를 반환해야합니다.
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
self.region1 = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID major:21668 minor:53482 identifier:@"EstimoteSampleRegion"];
self.region2= [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_MACBEACON_PROXIMITY_UUID major:3894 minor:57726 identifier:@"EstimoteSampleRegion2"];
self.region3= [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_IOSBEACON_PROXIMITY_UUID major:13067 minor:31901 identifier:@"EstimoteSampleRegion3"];
[self.beaconManager startRangingBeaconsInRegion:_region1];
[self.beaconManager startRangingBeaconsInRegion:_region3];
[self.beaconManager startRangingBeaconsInRegion:_region2];
// 위임 방법
-(void)beaconManager:(ESTBeaconManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region {
//checks bRegion, so you could have it searching for other beacons if you wanted after one is notified
NSLog(@"Start");
for (ESTBeacon *iBeacon in beacons) {
NSLog(@"%@",iBeacon.minor);
}
NSLog(@"Finish");
}
콘솔 O/P
Start
57726
Finish
Start
53482
Finish
Start
31901
Finish
Start
57726
Finish
예. 세 개의 iBeacons가 모두 있습니다. –