expo-background-fetch 11.1.0 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 11.2.0 — 2023-05-08
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 11.1.1 — 2023-02-09
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 11.1.0 — 2023-02-03
14
22
 
15
23
  ### 💡 Others
package/README.md CHANGED
@@ -9,7 +9,7 @@ Expo universal module for BackgroundFetch API
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For [managed](https://docs.expo.dev/versions/latest/introduction/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/).
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
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -18,7 +18,7 @@ For bare React Native projects, you must ensure that you have [installed and con
18
18
  ### Add the package to your npm dependencies
19
19
 
20
20
  ```
21
- expo install expo-background-fetch
21
+ npx expo install expo-background-fetch
22
22
  ```
23
23
 
24
24
  ### Configure for iOS
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '11.1.0'
6
+ version = '11.2.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -22,7 +22,7 @@ buildscript {
22
22
  if (ext.has("kotlinVersion")) {
23
23
  ext.kotlinVersion()
24
24
  } else {
25
- ext.safeExtGet("kotlinVersion", "1.6.10")
25
+ ext.safeExtGet("kotlinVersion", "1.8.10")
26
26
  }
27
27
  }
28
28
 
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
76
76
  versionCode 23
77
- versionName "11.1.0"
77
+ versionName "11.2.0"
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
@@ -32,7 +32,7 @@ export declare function setMinimumIntervalAsync(minimumInterval: number): Promis
32
32
  * const receivedNewData = // do your background fetch here
33
33
  * return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;
34
34
  * } catch (error) {
35
- * return BackgroundFetch.Result.Failed;
35
+ * return BackgroundFetch.BackgroundFetchResult.Failed;
36
36
  * }
37
37
  * });
38
38
  * ```
@@ -49,7 +49,7 @@ export async function setMinimumIntervalAsync(minimumInterval) {
49
49
  * const receivedNewData = // do your background fetch here
50
50
  * return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;
51
51
  * } catch (error) {
52
- * return BackgroundFetch.Result.Failed;
52
+ * return BackgroundFetch.BackgroundFetchResult.Failed;
53
53
  * }
54
54
  * });
55
55
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundFetch.js","sourceRoot":"","sources":["../src/BackgroundFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAEL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QAC7B,OAAO,qBAAqB,CAAC,SAAS,CAAC;KACxC;IACD,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC;AAC9C,CAAC;AAED,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,eAAuB;IACnE,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,EAAE;QAChD,OAAO;KACR;IACD,WAAW;IACX,MAAM,mBAAmB,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;AACrE,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,UAAkC,EAAE;IAEpC,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE;QAC1C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;KACvE;IACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE;QACxC,MAAM,IAAI,KAAK,CACb,SAAS,QAAQ,2FAA2F,CAC7G,CAAC;KACH;IACD,MAAM,mBAAmB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE;QAC5C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;KACzE;IACD,MAAM,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAA0B,CAAC","sourcesContent":["import { Platform, UnavailabilityError } from 'expo-modules-core';\nimport * as TaskManager from 'expo-task-manager';\n\nimport {\n BackgroundFetchOptions,\n BackgroundFetchResult,\n BackgroundFetchStatus,\n} from './BackgroundFetch.types';\nimport ExpoBackgroundFetch from './ExpoBackgroundFetch';\n\n// @needsAudit\n/**\n * Gets a status of background fetch.\n * @return Returns a promise which fulfils with one of `BackgroundFetchStatus` enum values.\n */\nexport async function getStatusAsync(): Promise<BackgroundFetchStatus | null> {\n if (Platform.OS === 'android') {\n return BackgroundFetchStatus.Available;\n }\n return ExpoBackgroundFetch.getStatusAsync();\n}\n\n// @needsAudit\n/**\n * Sets the minimum number of seconds that must elapse before another background fetch can be\n * initiated. This value is advisory only and does not indicate the exact amount of time expected\n * between fetch operations.\n *\n * > This method doesn't take any effect on Android. It is a global value which means that it can\n * overwrite settings from another application opened through Expo Go.\n *\n * @param minimumInterval Number of seconds that must elapse before another background fetch can be called.\n * @return A promise which fulfils once the minimum interval is set.\n */\nexport async function setMinimumIntervalAsync(minimumInterval: number): Promise<void> {\n if (!ExpoBackgroundFetch.setMinimumIntervalAsync) {\n return;\n }\n // iOS only\n await ExpoBackgroundFetch.setMinimumIntervalAsync(minimumInterval);\n}\n\n// @needsAudit\n/**\n * Registers background fetch task with given name. Registered tasks are saved in persistent storage and restored once the app is initialized.\n * @param taskName Name of the task to register. The task needs to be defined first - see [`TaskManager.defineTask`](taskmanager#defineTask)\n * for more details.\n * @param options An object containing the background fetch options.\n *\n * @example\n * ```ts\n * import * as BackgroundFetch from 'expo-background-fetch';\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, () => {\n * try {\n * const receivedNewData = // do your background fetch here\n * return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;\n * } catch (error) {\n * return BackgroundFetch.Result.Failed;\n * }\n * });\n * ```\n */\nexport async function registerTaskAsync(\n taskName: string,\n options: BackgroundFetchOptions = {}\n): Promise<void> {\n if (!ExpoBackgroundFetch.registerTaskAsync) {\n throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync');\n }\n if (!TaskManager.isTaskDefined(taskName)) {\n throw new Error(\n `Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`\n );\n }\n await ExpoBackgroundFetch.registerTaskAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Unregisters background fetch task, so the application will no longer be executing this task.\n * @param taskName Name of the task to unregister.\n * @return A promise which fulfils when the task is fully unregistered.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n if (!ExpoBackgroundFetch.unregisterTaskAsync) {\n throw new UnavailabilityError('BackgroundFetch', 'unregisterTaskAsync');\n }\n await ExpoBackgroundFetch.unregisterTaskAsync(taskName);\n}\n\nexport { BackgroundFetchResult, BackgroundFetchStatus, BackgroundFetchOptions };\n"]}
1
+ {"version":3,"file":"BackgroundFetch.js","sourceRoot":"","sources":["../src/BackgroundFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAEL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QAC7B,OAAO,qBAAqB,CAAC,SAAS,CAAC;KACxC;IACD,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC;AAC9C,CAAC;AAED,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,eAAuB;IACnE,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,EAAE;QAChD,OAAO;KACR;IACD,WAAW;IACX,MAAM,mBAAmB,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;AACrE,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,UAAkC,EAAE;IAEpC,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE;QAC1C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;KACvE;IACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE;QACxC,MAAM,IAAI,KAAK,CACb,SAAS,QAAQ,2FAA2F,CAC7G,CAAC;KACH;IACD,MAAM,mBAAmB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE;QAC5C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;KACzE;IACD,MAAM,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAA0B,CAAC","sourcesContent":["import { Platform, UnavailabilityError } from 'expo-modules-core';\nimport * as TaskManager from 'expo-task-manager';\n\nimport {\n BackgroundFetchOptions,\n BackgroundFetchResult,\n BackgroundFetchStatus,\n} from './BackgroundFetch.types';\nimport ExpoBackgroundFetch from './ExpoBackgroundFetch';\n\n// @needsAudit\n/**\n * Gets a status of background fetch.\n * @return Returns a promise which fulfils with one of `BackgroundFetchStatus` enum values.\n */\nexport async function getStatusAsync(): Promise<BackgroundFetchStatus | null> {\n if (Platform.OS === 'android') {\n return BackgroundFetchStatus.Available;\n }\n return ExpoBackgroundFetch.getStatusAsync();\n}\n\n// @needsAudit\n/**\n * Sets the minimum number of seconds that must elapse before another background fetch can be\n * initiated. This value is advisory only and does not indicate the exact amount of time expected\n * between fetch operations.\n *\n * > This method doesn't take any effect on Android. It is a global value which means that it can\n * overwrite settings from another application opened through Expo Go.\n *\n * @param minimumInterval Number of seconds that must elapse before another background fetch can be called.\n * @return A promise which fulfils once the minimum interval is set.\n */\nexport async function setMinimumIntervalAsync(minimumInterval: number): Promise<void> {\n if (!ExpoBackgroundFetch.setMinimumIntervalAsync) {\n return;\n }\n // iOS only\n await ExpoBackgroundFetch.setMinimumIntervalAsync(minimumInterval);\n}\n\n// @needsAudit\n/**\n * Registers background fetch task with given name. Registered tasks are saved in persistent storage and restored once the app is initialized.\n * @param taskName Name of the task to register. The task needs to be defined first - see [`TaskManager.defineTask`](taskmanager#defineTask)\n * for more details.\n * @param options An object containing the background fetch options.\n *\n * @example\n * ```ts\n * import * as BackgroundFetch from 'expo-background-fetch';\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, () => {\n * try {\n * const receivedNewData = // do your background fetch here\n * return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;\n * } catch (error) {\n * return BackgroundFetch.BackgroundFetchResult.Failed;\n * }\n * });\n * ```\n */\nexport async function registerTaskAsync(\n taskName: string,\n options: BackgroundFetchOptions = {}\n): Promise<void> {\n if (!ExpoBackgroundFetch.registerTaskAsync) {\n throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync');\n }\n if (!TaskManager.isTaskDefined(taskName)) {\n throw new Error(\n `Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`\n );\n }\n await ExpoBackgroundFetch.registerTaskAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Unregisters background fetch task, so the application will no longer be executing this task.\n * @param taskName Name of the task to unregister.\n * @return A promise which fulfils when the task is fully unregistered.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n if (!ExpoBackgroundFetch.unregisterTaskAsync) {\n throw new UnavailabilityError('BackgroundFetch', 'unregisterTaskAsync');\n }\n await ExpoBackgroundFetch.unregisterTaskAsync(taskName);\n}\n\nexport { BackgroundFetchResult, BackgroundFetchStatus, BackgroundFetchOptions };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-background-fetch",
3
- "version": "11.1.0",
3
+ "version": "11.2.0",
4
4
  "description": "Expo universal module for BackgroundFetch API",
5
5
  "main": "build/BackgroundFetch.js",
6
6
  "types": "build/BackgroundFetch.d.ts",
@@ -33,7 +33,7 @@
33
33
  "license": "MIT",
34
34
  "homepage": "https://docs.expo.dev/versions/latest/sdk/background-fetch/",
35
35
  "dependencies": {
36
- "expo-task-manager": "~11.1.0"
36
+ "expo-task-manager": "~11.2.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "expo-module-scripts": "^3.0.0"
@@ -41,5 +41,5 @@
41
41
  "peerDependencies": {
42
42
  "expo": "*"
43
43
  },
44
- "gitHead": "1815e2eaad8c753588c7b1eb74420174a28e01f4"
44
+ "gitHead": "4ba50c428c8369bb6b3a51a860d4898ad4ccbe78"
45
45
  }
@@ -57,7 +57,7 @@ export async function setMinimumIntervalAsync(minimumInterval: number): Promise<
57
57
  * const receivedNewData = // do your background fetch here
58
58
  * return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;
59
59
  * } catch (error) {
60
- * return BackgroundFetch.Result.Failed;
60
+ * return BackgroundFetch.BackgroundFetchResult.Failed;
61
61
  * }
62
62
  * });
63
63
  * ```