Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 2.48 KB

INSTALL-IOS-AUTO.md

File metadata and controls

77 lines (55 loc) · 2.48 KB

iOS Auto-linking Installation

react-native >= 0.60

With yarn

yarn add react-native-background-geolocation
  • For background-geolocation >= 4.0.0:
yarn add react-native-background-fetch@^4.0.1
  • For background-geolocation >= 3.6.0 < 4.0.0:
  • For background-geolocation <= 3.5.0

With npm

npm install react-native-background-geolocation --save
  • For background-geolocation >= 4.0.0:
npm install react-native-background-fetch@^4.0.1
  • For background-geolocation >= 3.6.0 < 4.0.0:
npm install [email protected] --save
  • For background-geolocation <= 3.5.0:
npm install [email protected] --save

pod install

$ cd ios
$ pod install

Configure Background Capabilities

Open your App in XCode and select the root of your project. Select Capabilities tab. Enable Background Modes and enable the following modes:

  • Location updates
  • Background fetch
  • Audio (optional for debug-mode sound FX)

Configure Usage Strings in Info.plist

Edit Info.plist. Add the following items (Set Value as desired):

Key Type Value
Privacy - Location Always and When in Use Usage Description String CHANGEME: Location required in background
Privacy - Location When in Use Usage Description String CHANGEME: Location required when app is in use
Privacy - Motion Usage Description String CHANGEME: Motion permission helps detect when device in in-motion

The BackgroundGeolocation SDK makes use internally on react-native-background-fetch. Regardless of whether you instend to implement the BackgroundFetch Javascript API in your app, you must perform the Background Fetch iOS Setup at react-native-background-fetch.