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

iOS — Region setup for Eddystone beacons

Open didacus opened this issue 7 years ago • 4 comments

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) => {

  }
);

didacus avatar Mar 20 '18 14:03 didacus

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) => {

  }
);

dukhanov avatar Mar 20 '18 14:03 dukhanov

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.

divye11 avatar Mar 30 '18 10:03 divye11

You have informed how to read Eddystone UID, how can I read Eddystones TLM?

brnyza avatar Jun 30 '21 19:06 brnyza

How can we read the eddystone url?

harveyconnor avatar Aug 30 '23 07:08 harveyconnor