You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iBeacon support for React Native. The API is very similar to the CoreLocation Objective-C one with the only major difference that regions are plain JavaScript objects.
5
-
Beacons don't work in the iOS simulator.
3
+
Beacon and GPS location support for React Native. The API is very similar to the CoreLocation Objective-C one with the only major difference that regions are plain JavaScript objects.
4
+
5
+
NOTE: Beacons don't work in the iOS simulator.
6
6
7
7
## Installation
8
-
Install using npm with `npm install --save react-native-ibeacon`
8
+
Install using npm with `npm install --save react-native-location`
9
9
10
-
You then need to add the Objective C part to your XCode project. Drag `RNBeacon.xcodeproj` from the `node_modules/react-native-ibeacon` folder into your XCode project. Click on the your project in XCode, goto Build Phases then Link Binary With Libraries and add `libRNBeacon.a` and `CoreLocation.framework`.
10
+
You then need to add the Objective C part to your XCode project. Drag `RNLocation.xcodeproj` from the `node_modules/react-native-location` folder into your XCode project. Click on the your project in XCode, goto Build Phases then Link Binary With Libraries and add `libRNLocation.a` and `CoreLocation.framework`.
11
11
12
-
NOTE: Make sure you don't have the `RNBeacon` project open separately in XCode otherwise it won't work.
12
+
NOTE: Make sure you don't have the `RNLocation` project open separately in XCode otherwise it won't work.
13
13
14
14
## Usage
15
15
```javascript
16
16
var React =require('react-native');
17
17
var {DeviceEventEmitter} = React;
18
18
19
-
varBeacons=require('react-native-ibeacon');
19
+
varLocation=require('react-native-location');
20
20
21
21
// Define a region which can be identifier + uuid,
22
22
// identifier + uuid + major or identifier + uuid + major + minor
@@ -27,12 +27,12 @@ var region = {
27
27
};
28
28
29
29
// Request for authorization while the app is open
30
-
Beacons.requestWhenInUseAuthorization();
30
+
Location.requestWhenInUseAuthorization();
31
31
32
-
Beacons.startMonitoringForRegion(region);
33
-
Beacons.startRangingBeaconsInRegion(region);
32
+
Location.startMonitoringForRegion(region);
33
+
Location.startRangingBeaconsInRegion(region);
34
34
35
-
Beacons.startUpdatingLocation();
35
+
Location.startUpdatingLocation();
36
36
37
37
// Listen for beacon changes
38
38
var subscription =DeviceEventEmitter.addListener(
@@ -70,7 +70,7 @@ Here, it's also recommended to set `NSLocationAlwaysUsageDescription` in your `I
70
70
71
71
## Methods
72
72
73
-
To access the methods, you need import the `react-native-ibeacon` module. This is done through `var Beacons = require('react-native-ibeacon')`.
73
+
To access the methods, you need import the `react-native-location` module. This is done through `var Beacons = require('react-native-location')`.
0 commit comments