$ npm install --save react-native-background-geolocation
react-native link react-native-background-geolocation
react-native link react-native-background-fetch
react-native link cocoa-lumberjack
You need rnpm
(npm install -g rnpm
)
rnpm link react-native-background-geolocation-android
rnpm link react-native-background-fetch
rnpm link cocoa-lumberjack
- Edit
Info.plist
. The plugin adds default values for the followingplist
elements. You will need to change these values as desired.
Key | Value | Description |
---|---|---|
NSLocationAlwaysUsageDescription | This app requires background tracking | Deprecated in iOS 11 The value here will be presented to the user when the plugin requests Background Location permission |
NSLocationAlwaysAndWhenInUseUsageDescription | This app requires background tracking | New for iOS 11 The value here will be presented to the user when the plugin requests Background Location permission |
NSMotionUsageDescription | Accelerometer use increases battery efficiency by intelligently toggling location-tracking | The value here will be presented to the user when the app requests Motion Activity permission. |