yarn add https://github.com/transistorsoft/react-native-background-geolocation-android.git
npm install git+https://[email protected]:transistorsoft/react-native-background-geolocation-android.git --save
react-native link react-native-background-geolocation-android
react-native link react-native-background-fetch
Podfile
:
yarn add cocoa-lumberjack
// <or npm>
npm install cocoa-lumberjack
react-native link cocoa-lumberjack
The cocoa-lumberjack
package is deprecated — it is no longer required when using Cocoapods. If you have cocoa-lumberjack
installed and you're using Cocoapods
, remove and unlink
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. |