frostney / react-native-ibeacon

:satellite: iBeacon support for React Native
MIT License
375 stars 54 forks source link

`authorizationDidChange` not firing #22

Open dlindahl opened 8 years ago

dlindahl commented 8 years ago

I can't seem to get authorizationDidChange to fire.

regionDidEnter and regionDidExit don't fire either, but I'm not sure what to expect so it hasn't been important yet.

beaconsDidRange works great.

Some pseudo-code:

const Region = {
  identifier: 'Radius Networks',
  uuid: UUID,
  major: 1,
  minor: 1
};

/* ... */

function authorizationDidChange(data) {
  console.info('authorizationDidChange', data);
}

DeviceEventEmitter.addListener('beaconsDidRange', beaconDidRange);
DeviceEventEmitter.addListener('regionDidEnter', regionDidEnter);
DeviceEventEmitter.addListener('regionDidExit', regionDidExit);
DeviceEventEmitter.addListener('authorizationDidChange', authorizationDidChange);

Beacons.requestWhenInUseAuthorization();

Beacons.startMonitoringForRegion(Region);
Beacons.startRangingBeaconsInRegion(Region);
Beacons.startUpdatingLocation();

Not sure what else to say beyond "it doesnt look like its working". Let me know if you need any additional info!

Here are some version numbers: