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

Application is closed when is called the "startRangingBeaconsInRegion"

Open GiacomoMasi opened this issue 4 years ago • 4 comments

Version

1.0.7

Platform

iOS | Android

OS version

iOS 10| android 7.0...

Steps to reproduce

I have this code in the ComponentDidMount:

componentDidMount() { Beacons.detectIBeacons(); const uuid = this.state.uuidRef; Beacons.startRangingBeaconsInRegion('REGION1', uuid) .then(() => console.log('Beacons ranging started succesfully')) .catch(error => console.log('Beacons ranging not started, error: ${error}'), ); }

Expected behavior

The application scans all beacons in the area.

Actual behavior

When I run the project, the app is installed on the device but when the app is launced, in a few seconds it is closed, I don't understand why.

GiacomoMasi avatar Nov 18 '19 08:11 GiacomoMasi

I also have this problem. No error message whatsoever.

rhyek avatar Dec 09 '19 00:12 rhyek

@GiacomoMasi @rhyek do you find solution for this issue ? As i am facing the same situation

Hassam34 avatar Dec 17 '19 11:12 Hassam34

@Hassam34, look at #154.

rhyek avatar Dec 17 '19 13:12 rhyek

I have the same problem, android.

my code:

const region = Platform.select({
      ios: {
        identifier: 'nameid',
        uuid: 'uuid'
      },
      android: {
        regionId: 'nameid',
        beaconsUUID: 'uuid',
      }
   })
   console.log('choice ', region)
    // Request for authorization while the app is open
    // Tells the library to detect iBeacons
    Beacons.detectIBeacons()

    // Start detecting all iBeacons in the nearby
    try {
      await Beacons.startRangingBeaconsInRegion(region)
      console.log(`Beacons ranging started succesfully!`)
    } catch(err) {
      console.log(`Beacons ranging not started, error: `, err)
    }

    // Print a log of the detected iBeacons (1 per second)
    DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
      console.log('Found beacons!', data.beacons)
    })

hadpro24 avatar May 22 '20 05:05 hadpro24