# iOS Setup ## Cocoapods If you're not using *Swift Package Manager*, you **must** adjust the `use_frameworks!` declaration to add the following property in your `ios/Podfile`: `use_frameworks!` should already exist — just append `:linkage => :static`: ```ruby target 'Runner' do use_frameworks! :linkage => :static # <-- append :linkage => :static . . . end ``` :warning: If you *don't* add the above line, you're going to get the following error when running `flutter build ios` ```console -> Installing background_fetch (1.5.0) - Running pre install hooks [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/chris/workspace/background-geolocation/flutter/tmp/fetch_foo/ios/Pods/TSBackgroundFetch/TSBackgroundFetch.xcframework) ``` ## Configure Background Capabilities - Select the root of your project. Select **Capabilities** tab. Enable **Background Modes** and enable the following mode: - [x] Background fetch - [x] Background processing (Only if you intend to use `BackgroundFetch.scheduleTask`) ![](https://dl.dropboxusercontent.com/s/9vik5kxoklk63ob/ios-setup-background-modes.png?dl=1) ## Configure `Info.plist` 1. Open your __`Info.plist`__ and add the key *"Permitted background task scheduler identifiers"* ![](https://dl.dropboxusercontent.com/s/t5xfgah2gghqtws/ios-setup-permitted-identifiers.png?dl=1) 2. Add the **required identifier `com.transistorsoft.fetch`**. ![](https://dl.dropboxusercontent.com/s/kwdio2rr256d852/ios-setup-permitted-identifiers-add.png?dl=1) 3. If you intend to execute your own [custom tasks](#executing-custom-tasks) via **`BackgroundFetch.scheduleTask`**, you must add those custom identifiers as well. For example, if you intend to execute a custom **`taskId: 'com.transistorsoft.customtask'`**, you must add the identifier **`com.transistorsoft.customtask`** to your *"Permitted background task scheduler identifiers"*, as well. :warning: Your custom task identifiers **MUST** be prefixed with `com.transistorsoft.`. ```dart BackgroundFetch.scheduleTask(TaskConfig( taskId: 'com.transistorsoft.customtask', delay: 60 * 60 * 1000 // In one hour (milliseconds) )); ```