react-native-beacons-manager
react-native-beacons-manager copied to clipboard
iOS — Region setup for Eddystone beacons
Based on the iOS Simple Example, how should I setup the region for Eddystone beacons? Is it possible to add an example to the repo?
Thank you in advance.
import { DeviceEventEmitter } from 'react-native'
import Beacons from 'react-native-beacons-manager'
const region = {
identifier: 'Eddystones',
uid: '953E1199A959B624DBAC'
};
// Request for authorization while the app is open
Beacons.requestWhenInUseAuthorization();
Beacons.startMonitoringForRegion(region);
Beacons.startRangingBeaconsInRegion(region);
Beacons.startUpdatingLocation();
// Listen for beacon changes
const subscription = DeviceEventEmitter.addListener(
'beaconsDidRange',
(data) => {
}
);
Here is an example:
import { DeviceEventEmitter } from 'react-native'
import Beacons from 'react-native-beacons-manager'
const region = {
identifier: 'EDDY_STONE_REGION_ID', // changed to EDDY_STONE_REGION_ID
uuid: '953E1199A959B624DBAC'
};
// Request for authorization while the app is open
Beacons.requestWhenInUseAuthorization();
Beacons.startMonitoringForRegion(region);
Beacons.startRangingBeaconsInRegion(region);
Beacons.startUpdatingLocation();
// Listen for beacon changes
const subscription = Beacons.BeaconsEventEmitter.addListener('beaconsDidRange',
(data) => {
}
);
Why do we need to feed uuid and region information in advance? I get region list from an API call and monitor then, but in iOS it limits upto 20 regions at once in ibeacon. Is it the same for eddystone? and I know if i keep uuid null i get events fired but that doesn't give me uuid.
You have informed how to read Eddystone UID, how can I read Eddystones TLM?
How can we read the eddystone url?