How detect multiple beacons iOS

How detect and use multiple beacons in iOS

More detail:
http://stackoverflow.com/questions/22340385/how-declare-estimote-array-for-many-beacons?lq=1

It seem that each beacon must have own region, but then how this work in beaconManager, because he will only see that first beacon:

-(void)beaconManager:(ESTBeaconManager *)manager
didRangeBeacons:(NSArray *)beaconsArray
inRegion:(ESTBeaconRegion *)region

More information: beaconsArray never has more than 1 count (nothing at index 1, 2 etc) I guess because each different beacon must require different region.

so how can I access multiple beacons.

Should each beacon have its own region or should all beacons be in same region. If each beacon has own region how do I access it

Hello,

As we've received plenty of questions about dealing with multiple beacons, here is a sample code snippet that should help out.
It shows how to implement notifications when entering a region with two beacons.

- (void)viewDidLoad {
  [super viewDidLoad];

  self.beaconManager = [[ESTBeaconManager alloc] init];
  self.beaconManager.delegate = self;

  self.firstBeaconRegion = [[ESTBeaconRegion alloc]
                            initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
                            major:1
                            minor:1
                            identifier:@"firstRegionIdentifier"];
  [self.beaconManager startMonitoringForRegion:self.firstBeaconRegion];

  self.firstBeaconRegion = [[ESTBeaconRegion alloc]
                            initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
                            major:2
                            minor:2
                            identifier:@"secondRegionIdentifier"];
  [self.beaconManager startMonitoringForRegion:self.secondBeaconRegion];
}

- (void)beaconManager:(ESTBeaconManager *)manager didEnterRegion:(ESTBeaconRegion *)region {
  if ([region.identifier isEqualToString:@"firstRegionIdenfifier"]) {
    // do something
  } else if ([region.identifier isEqualToString:@"secondRegionIdentifier"]) {
    // do something else
  }
}

Let us know, if you have any follow-up questions.

Taku,

Please find the answer to your question by our developer on this page:
http://stackoverflow.com/questions/22340385/how-declare-estimote-array-for-many-beacons?lq=1

Let us know, if you have any other questions.

How to access each region after declared multiple regions ? I already have setup for 2 beacons and 2 becaonmanagers

If you want to monitor for multiply regions, initialize them with unique indentifiers. In the didEnter and didExit callbacks you will be able to differentiate them using those identifiers.

By the way, region identifiers should be declared as #define.

Hi, I tried this and it worked perfectly! Now I'm trying to send a different message if you are near a particular beacon, how can I do this if both beacons are within range?