1 | # expo-background-fetch
|
2 |
|
3 | Expo universal module for BackgroundFetch API
|
4 |
|
5 | # API documentation
|
6 |
|
7 | - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/background-fetch.mdx)
|
8 | - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/background-fetch/)
|
9 |
|
10 | # Installation in managed Expo projects
|
11 |
|
12 | For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/background-fetch/).
|
13 |
|
14 | # Installation in bare React Native projects
|
15 |
|
16 | For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
17 |
|
18 | ### Add the package to your npm dependencies
|
19 |
|
20 | ```
|
21 | npx expo install expo-background-fetch
|
22 | ```
|
23 |
|
24 | ### Configure for iOS
|
25 |
|
26 | Run `npx pod-install` after installing the npm package.
|
27 |
|
28 | In order to use `BackgroundFetch` API in standalone, detached and bare apps on iOS, your app has to include background mode in the `Info.plist` file. See [background tasks configuration guide](https://docs.expo.dev/versions/latest/sdk/task-manager/#configuration-for-standalone-apps) for more details.
|
29 |
|
30 | ### Configure for Android
|
31 |
|
32 | No additional set up necessary.
|
33 |
|
34 | This module might listen when the device is starting up. It's necessary to continue working on tasks started with `startOnBoot`. It also keeps devices "awake" that are going idle and asleep fast, to improve reliability of the tasks.
|
35 |
|
36 | ```xml
|
37 | <!-- Added permissions -->
|
38 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
39 | <uses-permission android:name="android.permission.WAKE_LOCK" />
|
40 | ```
|
41 |
|
42 | # Contributing
|
43 |
|
44 | Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
|