MacKentoch / react-native-beacons-manager

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

App crashes #174

Open mishkeTz opened 4 years ago

mishkeTz commented 4 years ago

Version

1.0.7

Platform

Android

OS version

Android 9

Steps to reproduce

  1. Fresh RN project - npx react-native init AwesomeProject

Expected behavior

It should show the beacons and not close the app.

Actual behavior

I have this piece of code in a component

componentDidMount() {
  Beacons.detectIBeacons();

    Beacons
    .startRangingBeaconsInRegion('some id', '7b44b47b-52a1-5381-90c2-f09b6838c5d4') // or like  < v1.0.7: .startRangingBeaconsInRegion(identifier, uuid)
    .then(() => console.log('Beacons ranging started succesfully'))
    .catch(error => console.log(`Beacons ranging not started, error: ${error}`));
}

And the app closes (crashes).

Saumyadip-Pramanik commented 4 years ago

Hi @mishkeTz, I have resolved the crash with the following code: const region = Platform.select({ ios: { identifier: 'region', uuid: 'YOUR_BEACON_UDID' }, android: { regionId: 'region', beaconsUUID: 'YOUR_BEACON_UDID', } })

But I am getting the error: uniqueid may not be null

mbretter commented 4 years ago

I had the same issue (dependency problem with rn), look at: #154

mozart27 commented 4 years ago

@Saumyadip-Pramanik I'm experiencing the same crash. How did setting your region fix this? Also, what does your call to startRangingBeaconsInRegion look like?

robertobrogi commented 4 years ago

Hi all, i hav ethe same problem.... there is any solution?

i use expo 37.0.0 eject with react 0.61.5

but make a crash.... i try to follow every fix but nothing.....

LucasHdS commented 4 years ago

Any solution ?? I tried this issue's solution: #154. But didn't work for me.

rohitmodi12 commented 4 years ago

Hello team, I got the solution Please use for android Beacons.startRangingBeaconsInRegion('Estimotes', '8492E75F-4FD6-469D-B132-043FE94921D8')

instead of

const region = { identifier: 'Estimotes', uuid: '8492E75F-4FD6-469D-B132-043FE94921D8' }; await Beacons.startRangingBeaconsInRegion(region)