0.3.2 • Published 12 months ago

react-native-beacon-radar v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-native-beacon-radar

CURRENTLY IN PROGRESS.... RIGHT NOW ONLY SCANS FOR CERTAIN IBEACON

Package to scan for iBeacons on both Android and IOS. This module is fully compatible with Expo (Will not work with Expo Go, but will work with development build.)

Installation

npm install react-native-beacon-radar

OR

yarn add react-native-beacon-radar

Basic usage

import { DeviceEventEmitter } from 'react-native';
import { startScanning } from 'react-native-beacon-radar';

// ...

startScanning('YOUR UUID', {
  useForegroundService: true,
  useBackgroundScanning: true,
});

DeviceEventEmitter.addListener('onBeaconsDetected', (beacons) => {
  console.log('onBeaconsDetected', beacons);
});

Current API:

MethodDescription
requestWhenInUseAuthorizationThis method should be called before anything else is called. It handles to request the use of beacons while the application is open. If the application is in the background, you will not get a signal from beacons.
requestAlwaysAuthorizationThis method should be called before anything else is called. It handles to request the use of beacons while the application is open or in the background.
getAuthorizationStatusThis methods gets the current authorization status.
startScanningThis method starts scanning for a certain beacon based on its UUID.
startRadar (Android only)This method starts scanning for all beacons in range. This is only available on Android.
EventDescription
onBeaconsDetectedThis event gets called when the beacon you are searching for is in range.

Expo

This module will work with the Expo managed workflow. It will not however work with Expo Go, since it needs native features. You can use the development build of Expo to test this module. More about this can be found here. To use this module in expo managed add the following to your app.json:

"expo": {
  "ios": {
    "infoPlist": {
      "NSLocationWhenInUseUsageDescription": "We need your location to detect nearby beacons.",
      "NSLocationAlwaysUsageDescription": "We need your location to detect nearby beacons even when the app is in the background.",
      "NSLocationAlwaysAndWhenInUseUsageDescription": "We need your location to detect nearby beacons even when the app is in the background."
    }
  },
  "plugins": [
    "react-native-beacon-radar"
  ]
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.2

12 months ago

0.3.1

12 months ago

0.3.0

12 months ago

0.2.10

12 months ago

0.2.9

12 months ago

0.2.8

12 months ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago