react-native-beacons-manager icon indicating copy to clipboard operation
react-native-beacons-manager copied to clipboard

Ranging iBeacons not detected.

Open konrad-marzec opened this issue 7 years ago • 7 comments

Version

1.0.6

Platform

Android

OS version

android 7.1

Steps to reproduce

  1. I have installed demo app
const subscription = DeviceEventEmitter.addListener(
  'beaconsDidRange',
  (data) => {
    console.log(data.beacons) - Array of all beacons inside a region
  }
);

Expected behavior

beacons aarray should include my beacon

Actual behavior

beacons array is empty

konrad-marzec avatar Oct 31 '17 19:10 konrad-marzec

Hi,

It is an old version.

Is there any reason why you don't use v1.0.7 in your app?

I'm currently working on a HUGE (for Android) update with v1.1.0 in master branch. On Android, I can range multiple types of beacons (iBeacon, eddyStone...) - tested these days.

Please have a try with the master branch version just to be sure it does not come from something else.

MacKentoch avatar Nov 07 '17 15:11 MacKentoch

@MacKentoch - is the new (Android) version suppose to include support for detection when the app is killed (https://github.com/Estimote/Android-SDK/issues/62#issuecomment-342522028)

oferRounds avatar Nov 08 '17 15:11 oferRounds

I am having the same problem (no beacons showing up for ranging) with Android. I have not tried on iOS, as my app is exclusively Android. I tried updating to the master branch version and experienced the crash on launch issue that other people have been having. More importantly I looked at the small amount of log I got before the crash and I noticed the exact same behavior as before: beaconsDidRange is being called, but no beacons despite the clear and measurable presence of beacons. I was also using 1.0.7, so I don't think it's a version issue.

What did seem curious is that, although I did apply an identifier to my ranging, the android log output seemed unaware of ids for the region: D/BeaconsAndroidModule: rangingConsumer didRangeBeaconsInRegion, region: id1: null id2: null id3: null That could be normal, but it would make sense that if no regions are ranging then no beacons would result. I also noticed: D/BluetoothLeScanner: could not find callback wrapper

For context, here is the code that I am using from start to finish (more or less):

import Beacons from 'react-native-beacons-manager';

const region = {
   uuid: '...',
   identifier: '1'
}

Beacons.detectIBeacons()

Beacons.startMonitoringForRegion(region).then(() => {
  console.log('Started monitoring', region);
}).catch((error) => {
  console.log('Failed to start monitoring!', error);
});

Beacons.startRangingBeaconsInRegion(region.identifier, region.uuid).then(() => {
   console.log('Started ranging');

  DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
     console.log(data);
  });
}).catch((error) => {
  console.log('Failed to range');
  console.log(error);
});

For both monitoring and ranging it logs successfully starting both. For clarity I tried without a UUID for ranging as well, with the same result

Here are the permissions in the AndroidManifest.xml:

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

johnlev avatar Dec 15 '17 23:12 johnlev

Update: I noticed that the monitoring does work, more or less, but I need ranging as well. If anyone has had this issue I would greatly appreciate knowing how you fixed it

johnlev avatar Dec 16 '17 15:12 johnlev

@johnlev I have the same issue :(. Could you solve the problem?

anirom avatar Sep 20 '18 01:09 anirom

Hi,

It is an old version.

Is there any reason why you don't use v1.0.7 in your app?

I'm currently working on a HUGE (for Android) update with v1.1.0 in master branch. On Android, I can range multiple types of beacons (iBeacon, eddyStone...) - tested these days.

Please have a try with the master branch version just to be sure it does not come from something else.

Hi @MacKentoch, i tried to install from branch master, but I got an error like this

whatsapp image 2018-09-20 at 8 27 01 pm

How to fixed it? Thanks

bonkzero404 avatar Sep 20 '18 13:09 bonkzero404

+1

ycldz avatar Nov 02 '22 07:11 ycldz