Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 2.31 KB

INSTALL-MANUAL-IOS.md

File metadata and controls

50 lines (32 loc) · 2.31 KB

iOS Manual Installation

  • npm install react-native-background-fetch --save

  • In the XCode's Project navigator, right click on project's name ➜ Add Files to <...>

  • Add node_modules/react-native-background-fetch/ios/RNBackgroundFetch.xcodeproj

Build Phases ➜ Link Binary With Libraries

  • Select your project in the Project navigator. Click Build Phases then Link Binary With Libraries. Add the following static library:

  • libRNBackgroundFetch.a.

  • BackgroundGeolocation includes custom iOS framework. This needs to be added manually, unfortunately.

    • Click [Add Other...].
    • Navigate: node_modules/react-native-background-fetch/ios/RNBackgroundFetch.
    • Add TSBackgroundFetch.framework.

Build Settings ➜ Framework Search Paths

  • In order to the find the TSBackgroundFetch.framework you just added, you have to tell Xcode where it can find it:
    • Go to Build Settings and search for "framework search path".
    • Add the following paths (select recursive [v]):
$(PROJECT_DIR)/../node_modules/react-native-background-fetch/ios

Configure Background Capabilities

  • Select the root of your project. Select Capabilities tab. Enable Background Modes and enable the following mode:

  • Background fetch

BackgroundFetch AppDelegate extension

BackgroundFetch implements an AppDelegate method didPerformFetchWithCompletionHandler. You must manually add this file to the same folder where your AppDelegate.m lives:

  • Expand the RNBackgroundFetch project and drag/drop the file RNBackgroundFetch+AppDelegate.m and place the file to exist in the same folder as your app's AppDelegate.m.

You can now import and build