MacKentoch / react-native-beacons-manager

React-Native library for detecting beacons (iOS and Android)
MIT License
582 stars 317 forks source link

beacon detection issue #269

Open SingothuSrinu opened 1 year ago

SingothuSrinu commented 1 year ago

Version

latest

Platform

Android

OS version

13 android

Steps to reproduce

Expected behavior

After getting 1st beacon data if we approach 2nd beacon it has to detect 2nd beacon and get data from beacon

Actual behavior

when ever app is launch, app detects 1st beacon( navigate and come back to initial screen) and we approach to second beacon scanning is stop

const region = { identifier: 'NAME', uuid: '*****16digit code **', };

        if (Platform.OS === 'android') {
            Beacons.setForegroundScanPeriod(1000);
            Beacons.startMonitoringForRegion(region)
            Beacons.startRangingBeaconsInRegion(region);
            this.beaconListner = Beacons.BeaconsEventEmitter.addListener(
                'beaconsDidRange',
                data => {
                    if (data?.beacons && data.beacons.length > 0) {
                         console.log('beacon data' + data.beacons);
                        this.validateBeacons(data);
                    } else console.log('else condition collision' + data.beacons.length);
                },
            );
        } 
yasintz commented 10 months ago

I am recommending to use https://github.com/JanSneeuw/react-native-beacon-radar

noway commented 10 months ago

@SingothuSrinu update org.altbeacon:android-beacon-library in react-native-beacons-manager/android/build.gradle to 2.20.1. But there are some incompatibilities with the values the new AltBeacon library version outputs. More work needed.