octavioturra / react-native-alt-beacon

A work-in-progress lib to work with AltBeacon and React Native.
MIT License
34 stars 10 forks source link

Ranging: Array of beacons is empty #1

Open andrekovac opened 8 years ago

andrekovac commented 8 years ago

When ranging for beacons, the array of beacons (last line in the code excerpt from RNABeacon.java below) is always empty. I tested with the exact same BeaconLayout and Configuration in a small Android dummy app. There the array has data and I can successfully range the beacons.

To test the package I added two more events (see the code excerpt below) . The new events didServiceConnect and didRangeBeaconsInRegionEnter do get called, but because the array is zero didFoundBeacons is never called, but didNotFoundBeacons is called instead.

Any thoughts?

private BeaconConsumer rangingConsumer = new BeaconConsumer() {
        @Override
        public void onBeaconServiceConnect() {
            sendEvent(context, "didServiceConnect", null);
            beaconManager.setRangeNotifier(new RangeNotifier() {
                @Override
                public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
                    sendEvent(context, "didRangeBeaconsInRegionEnter", null);
                    WritableMap map = new WritableNativeMap();
                    map.putString("uuid", region.getUniqueId());

                    if (beacons.size() > 0) {
octavioturra commented 8 years ago

Are you matching the same region UUID?

andrekovac commented 8 years ago

Yes, I was using the correct UUID. I did these tests almost two months ago and now testing your current version. See #4

andrekovac commented 8 years ago

I now tried your example app. It unfortunately doesn't show any beacons when ranging as before. It is the correct UUID and other beacon detection apps, show the beacons on the same phone.

So I believe your implementation just doesn't work with Kontakt.io beacons yet..

chouroukmrad commented 8 years ago

Any update on this? I'm always getting "didNotFoundBeacons" .