react-native-beacon-broadcast

A cool package for simulate your devices as beacon


Keywords
react-native, react, bluetooth, ibeacon, beacon simulator
License
MIT
Install
npm install react-native-beacon-broadcast@1.0.1

Documentation

React Native Module that broadcasts an iBeacon uuid.

Setup

npm i --save react-native-beacon-broadcast

react-native link

Import in your project:

import BeaconBroadcast from 'react-native-beacon-broadcast'

API

Start iBeacon on device:

uuid: String

You can get from here http://openuuid.net/

identifier: String

minor and major:

are integer values between 0 and 65535.

Start Broadcasting iBeacon:

BeaconBroadcast.startAdvertisingBeaconWithString(uuid, identifier, major, minor)

Stop Broadcasting iBeacon:

BeaconBroadcast.stopAdvertisingBeacon()

iOS

BeaconBroadcast.stopAdvertisingBeacon()
BeaconBroadcast.startAdvertisingBeaconWithString(uuid, identifier, major, minor)

Android

BeaconBroadcast.checkTransmissionSupported()
.then(() => {
  BeaconBroadcast.stopAdvertisingBeacon()
  BeaconBroadcast.startAdvertisingBeaconWithString(uuid, identifier, major, minor)
})
.catch((e) => {
  /* handle return errors */
  - NOT_SUPPORTED_MIN_SDK
  - NOT_SUPPORTED_BLE
  - DEPRECATED_NOT_SUPPORTED_MULTIPLE_ADVERTISEMENTS
  - NOT_SUPPORTED_CANNOT_GET_ADVERTISER
  - NOT_SUPPORTED_CANNOT_GET_ADVERTISER_MULTIPLE_ADVERTISEMENTS
})