I have started experimenting with beacons. I successfully created a sample code that works fine with one beacon. Now I want to add multiple beacons so all can be tracked. I followed this link for my sample code (https://ionicallyspeaking.com/2017/01/16/creating-a-beacon-application-with-ionic-2/comment-page-1/#comment-382)
To track multiple beacons I just repeated the region creation and start ranging on region code as follows
// setup a beacon region
this.region = IBeacon.BeaconRegion('deskBeacon', 'F7826DA6-4FA2-4E98-8024-BC5B71E0893E');
this.region2 = IBeacon.BeaconRegion('deskBeacon', 'F7826DA6-4FA2-4E98-8024-BC5B71E0893F');
// start ranging
IBeacon.startRangingBeaconsInRegion(this.region)
.then(
() => {
resolve(true);
},
error => {
console.error('Failed to begin monitoring: ', error);
resolve(false);
}
);
IBeacon.startRangingBeaconsInRegion(this.region2)
.then(
() => {
resolve(true);
},
error => {
console.error('Failed to begin monitoring: ', error);
resolve(false);
}
);
The problem is that only the second beacon is detected. What am I doing wrong?