mmazzarolo / react-native-beacons-android

A React-Native library for detecting beacons on Android
MIT License
74 stars 15 forks source link

Ranging for multiple beacons #12

Closed mmazzarolo closed 8 years ago

mmazzarolo commented 8 years ago

From #10, @mint3000 :

is it possible to range for multiple beacons? Something like this:

_.forEach(portraitData, (portrait) => {
Beacons.startRangingBeaconsInRegion('REGION1', portrait.uuid)
      .then(() => console.log(`Beacons ranging started succesfully`))
      .catch(error => console.log(`Beacons ranging not started, error: ${error}`));
});

When I run this, it seems to only monitor the last UUID in portraitData. Any ideas?

Nice question.
Currently the library handles only one ranging sessions (and the altBeacon library used internally doesn't seem to support multiple monitoring/ranging).
Does anybody know if react-native-ibeacon allows multiple ranging?

Interesting discussions: Multiple Monitoring, Ranging Notifiers

mmazzarolo commented 8 years ago

@mint3000 Hey, I just released a new beta version of this library on npm: react-native-beacons-android 2.0.0-beta.1.
In this new version you should be able to range for multiple beacons, just remember to use a different identifier (from the example above: 'REGION1') for each ranging attempt.

Let me know if it works... it is still in beta 👍

mmazzarolo commented 8 years ago

Feedbacks on this feature are welcome here.