expo-background-fetch 13.1.1 → 13.1.2
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 +6 -0
- package/android/build.gradle +2 -2
- package/build/BackgroundFetch.d.ts.map +1 -1
- package/build/BackgroundFetch.js +17 -0
- package/build/BackgroundFetch.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.module → 13.1.2/expo.modules.backgroundfetch-13.1.2.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.pom → 13.1.2/expo.modules.backgroundfetch-13.1.2.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.2/expo.modules.backgroundfetch-13.1.2.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/BackgroundFetch.ts +20 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/13.1.1/expo.modules.backgroundfetch-13.1.1.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1-sources.jar → 13.1.2/expo.modules.backgroundfetch-13.1.2-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1-sources.jar.md5 → 13.1.2/expo.modules.backgroundfetch-13.1.2-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1-sources.jar.sha1 → 13.1.2/expo.modules.backgroundfetch-13.1.2-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1-sources.jar.sha256 → 13.1.2/expo.modules.backgroundfetch-13.1.2-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1-sources.jar.sha512 → 13.1.2/expo.modules.backgroundfetch-13.1.2-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.aar → 13.1.2/expo.modules.backgroundfetch-13.1.2.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.aar.md5 → 13.1.2/expo.modules.backgroundfetch-13.1.2.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.aar.sha1 → 13.1.2/expo.modules.backgroundfetch-13.1.2.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.aar.sha256 → 13.1.2/expo.modules.backgroundfetch-13.1.2.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/{13.1.1/expo.modules.backgroundfetch-13.1.1.aar.sha512 → 13.1.2/expo.modules.backgroundfetch-13.1.2.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 13.1.2 — 2025-04-11
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Added warning about Background Fetch not being supported in Expo Go ([#36063](https://github.com/expo/expo/pull/36063) by [@chrfalch](https://github.com/chrfalch))
|
|
18
|
+
|
|
13
19
|
## 13.1.1 — 2025-04-09
|
|
14
20
|
|
|
15
21
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '13.1.
|
|
7
|
+
version = '13.1.2'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.backgroundfetch"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 23
|
|
13
|
-
versionName "13.1.
|
|
13
|
+
versionName "13.1.2"
|
|
14
14
|
consumerProguardFiles("proguard-rules.pro")
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundFetch.d.ts","sourceRoot":"","sources":["../src/BackgroundFetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BackgroundFetch.d.ts","sourceRoot":"","sources":["../src/BackgroundFetch.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAgCjC;;;;;GAKG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAO5E;AAGD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQpF;AAGD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAaf;AAGD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzE;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAC"}
|
package/build/BackgroundFetch.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunningInExpoGo } from 'expo';
|
|
1
2
|
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
3
|
import * as TaskManager from 'expo-task-manager';
|
|
3
4
|
import { BackgroundFetchResult, BackgroundFetchStatus, } from './BackgroundFetch.types';
|
|
@@ -9,6 +10,20 @@ const showDeprecationWarning = () => {
|
|
|
9
10
|
console.warn('expo-background-fetch: This library is deprecated. Use expo-background-task instead.');
|
|
10
11
|
}
|
|
11
12
|
};
|
|
13
|
+
let warnedAboutExpoGo = false;
|
|
14
|
+
function _validate(taskName) {
|
|
15
|
+
if (isRunningInExpoGo()) {
|
|
16
|
+
if (!warnedAboutExpoGo) {
|
|
17
|
+
const message = '`Background Fetch` functionality is not available in Expo Go:\n' +
|
|
18
|
+
'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';
|
|
19
|
+
console.warn(message);
|
|
20
|
+
warnedAboutExpoGo = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (!taskName || typeof taskName !== 'string') {
|
|
24
|
+
throw new TypeError('`taskName` must be a non-empty string.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
12
27
|
// @needsAudit
|
|
13
28
|
/**
|
|
14
29
|
* Gets a status of background fetch.
|
|
@@ -78,6 +93,7 @@ export async function registerTaskAsync(taskName, options = {}) {
|
|
|
78
93
|
if (!TaskManager.isTaskDefined(taskName)) {
|
|
79
94
|
throw new Error(`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`);
|
|
80
95
|
}
|
|
96
|
+
_validate(taskName);
|
|
81
97
|
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
|
|
82
98
|
}
|
|
83
99
|
// @needsAudit
|
|
@@ -93,6 +109,7 @@ export async function unregisterTaskAsync(taskName) {
|
|
|
93
109
|
if (!ExpoBackgroundFetch.unregisterTaskAsync) {
|
|
94
110
|
throw new UnavailabilityError('BackgroundFetch', 'unregisterTaskAsync');
|
|
95
111
|
}
|
|
112
|
+
_validate(taskName);
|
|
96
113
|
await ExpoBackgroundFetch.unregisterTaskAsync(taskName);
|
|
97
114
|
}
|
|
98
115
|
export { BackgroundFetchResult, BackgroundFetchStatus };
|
|
@@ -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,IAAI,yBAAyB,GAAG,KAAK,CAAC;AAEtC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IAClC,IAAI,CAAC,yBAAyB,EAAE,CAAC;QAC/B,yBAAyB,GAAG,IAAI,CAAC;QACjC,OAAO,CAAC,IAAI,CACV,sFAAsF,CACvF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,sBAAsB,EAAE,CAAC;IAEzB,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,qBAAqB,CAAC,SAAS,CAAC;IACzC,CAAC;IACD,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC;AAC9C,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,eAAuB;IACnE,sBAAsB,EAAE,CAAC;IAEzB,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,EAAE,CAAC;QACjD,OAAO;IACT,CAAC;IACD,WAAW;IACX,MAAM,mBAAmB,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;AACrE,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,UAAkC,EAAE;IAEpC,sBAAsB,EAAE,CAAC;IAEzB,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,CAAC;QAC3C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,SAAS,QAAQ,2FAA2F,CAC7G,CAAC;IACJ,CAAC;IACD,MAAM,mBAAmB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,sBAAsB,EAAE,CAAC;IAEzB,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;QAC7C,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;IAC1E,CAAC;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\nlet didShowDeprecationWarning = false;\n\nconst showDeprecationWarning = () => {\n if (!didShowDeprecationWarning) {\n didShowDeprecationWarning = true;\n console.warn(\n 'expo-background-fetch: This library is deprecated. Use expo-background-task instead.'\n );\n }\n};\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 * @deprecated Use [`getStatusAsync()`](./background-task/#backgroundtaskgetstatusasync) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function getStatusAsync(): Promise<BackgroundFetchStatus | null> {\n showDeprecationWarning();\n\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 * @deprecated Use the [`registerTaskAsync()`](./background-task#backgroundtaskregistertaskasynctaskname-options) method\n * from expo-background-task package, and specify [`BackgroundTaskOptions`](./background-task/#backgroundtaskoptions)\n * argument instead, when setting task interval time.\n */\nexport async function setMinimumIntervalAsync(minimumInterval: number): Promise<void> {\n showDeprecationWarning();\n\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`](task-manager/#taskmanagerdefinetaskttaskname-taskexecutor)\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 * @deprecated Use [`registerTaskAsync()`](./background-task#backgroundtaskregistertaskasynctaskname-options) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function registerTaskAsync(\n taskName: string,\n options: BackgroundFetchOptions = {}\n): Promise<void> {\n showDeprecationWarning();\n\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 * @deprecated Use [`unregisterTaskAsync()`](./background-task/#backgroundtaskunregistertaskasynctaskname) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n showDeprecationWarning();\n\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":"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","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport { 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\nlet didShowDeprecationWarning = false;\n\nconst showDeprecationWarning = () => {\n if (!didShowDeprecationWarning) {\n didShowDeprecationWarning = true;\n console.warn(\n 'expo-background-fetch: This library is deprecated. Use expo-background-task instead.'\n );\n }\n};\n\nlet warnedAboutExpoGo = false;\n\nfunction _validate(taskName: unknown) {\n if (isRunningInExpoGo()) {\n if (!warnedAboutExpoGo) {\n const message =\n '`Background Fetch` functionality is not available in Expo Go:\\n' +\n 'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';\n console.warn(message);\n warnedAboutExpoGo = true;\n }\n }\n if (!taskName || typeof taskName !== 'string') {\n throw new TypeError('`taskName` must be a non-empty string.');\n }\n}\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 * @deprecated Use [`getStatusAsync()`](./background-task/#backgroundtaskgetstatusasync) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function getStatusAsync(): Promise<BackgroundFetchStatus | null> {\n showDeprecationWarning();\n\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 * @deprecated Use the [`registerTaskAsync()`](./background-task#backgroundtaskregistertaskasynctaskname-options) method\n * from expo-background-task package, and specify [`BackgroundTaskOptions`](./background-task/#backgroundtaskoptions)\n * argument instead, when setting task interval time.\n */\nexport async function setMinimumIntervalAsync(minimumInterval: number): Promise<void> {\n showDeprecationWarning();\n\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`](task-manager/#taskmanagerdefinetaskttaskname-taskexecutor)\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 * @deprecated Use [`registerTaskAsync()`](./background-task#backgroundtaskregistertaskasynctaskname-options) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function registerTaskAsync(\n taskName: string,\n options: BackgroundFetchOptions = {}\n): Promise<void> {\n showDeprecationWarning();\n\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 _validate(taskName);\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 * @deprecated Use [`unregisterTaskAsync()`](./background-task/#backgroundtaskunregistertaskasynctaskname) from `expo-background-task`\n * instead. The `expo-background-fetch` package has been deprecated.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n showDeprecationWarning();\n\n if (!ExpoBackgroundFetch.unregisterTaskAsync) {\n throw new UnavailabilityError('BackgroundFetch', 'unregisterTaskAsync');\n }\n _validate(taskName);\n await ExpoBackgroundFetch.unregisterTaskAsync(taskName);\n}\n\nexport { BackgroundFetchResult, BackgroundFetchStatus, BackgroundFetchOptions };\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.backgroundfetch",
|
|
6
|
-
"version": "13.1.
|
|
6
|
+
"version": "13.1.2",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.backgroundfetch-13.1.
|
|
28
|
-
"url": "expo.modules.backgroundfetch-13.1.
|
|
27
|
+
"name": "expo.modules.backgroundfetch-13.1.2.aar",
|
|
28
|
+
"url": "expo.modules.backgroundfetch-13.1.2.aar",
|
|
29
29
|
"size": 16359,
|
|
30
30
|
"sha512": "a1efa7055b1171c498a0f77a67fc91792692ceffe007b135623dcfcad731281e862d90abafda7e481241817e211de8f30b8ee81e8b9d6d7f1da39b363688f224",
|
|
31
31
|
"sha256": "fc11238742920dee7b2b3cc852d414c0d88175138f12c52f04611762f6e007a0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
],
|
|
54
54
|
"files": [
|
|
55
55
|
{
|
|
56
|
-
"name": "expo.modules.backgroundfetch-13.1.
|
|
57
|
-
"url": "expo.modules.backgroundfetch-13.1.
|
|
56
|
+
"name": "expo.modules.backgroundfetch-13.1.2.aar",
|
|
57
|
+
"url": "expo.modules.backgroundfetch-13.1.2.aar",
|
|
58
58
|
"size": 16359,
|
|
59
59
|
"sha512": "a1efa7055b1171c498a0f77a67fc91792692ceffe007b135623dcfcad731281e862d90abafda7e481241817e211de8f30b8ee81e8b9d6d7f1da39b363688f224",
|
|
60
60
|
"sha256": "fc11238742920dee7b2b3cc852d414c0d88175138f12c52f04611762f6e007a0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
76
|
-
"name": "expo.modules.backgroundfetch-13.1.
|
|
77
|
-
"url": "expo.modules.backgroundfetch-13.1.
|
|
76
|
+
"name": "expo.modules.backgroundfetch-13.1.2-sources.jar",
|
|
77
|
+
"url": "expo.modules.backgroundfetch-13.1.2-sources.jar",
|
|
78
78
|
"size": 3461,
|
|
79
79
|
"sha512": "20eebb9eba4239ad138aa98fd15fba3aacaea19dc834094ee88b0668211a95f233d99eaa1cab0531ccf779d6aa6d36bb583d85e35fdb30f180289ce29a43e578",
|
|
80
80
|
"sha256": "3592ee09c21c9612c7b0c5664b5c258dd41010f4ae7c237e06a59448a75a3b52",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3ac259c4667d33f298b60fbcd880d6fb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
081b87a93edee3682c96c43620199c10cafed81d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f227b7fedd3f4165e00a31ff7c6e71ca8931261ad8cd7c5ae550019a545d5639
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ca8b2c8a6f831f5119b9a0b4b18fe3c1945b608e40d3a74bab2d644b27e0ffbbe76b22984cad522a01ca8336e066ff1a785b9f3fe954e7a0d17f4d57a4a48896
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.backgroundfetch</artifactId>
|
|
12
|
-
<version>13.1.
|
|
12
|
+
<version>13.1.2</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.backgroundfetch</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
929aeaa8145543ce8ba0103b79212e7c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5d12bc8f0f9e214c4ac7c7895e6cebc80286e91b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
25c0d5352d038ec2d0034be7b6437095e3b32a6b49e22832027bf18c1f7aaf6f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
281af48390b1897db7574379bd62bf2b778c08bda880e797c062787f12ad2a7933e21babc0ef4cc9e7732b7dc683487bc122c51e442c4feab6b37c68b67ded5d
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.backgroundfetch</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>13.1.
|
|
7
|
-
<release>13.1.
|
|
6
|
+
<latest>13.1.2</latest>
|
|
7
|
+
<release>13.1.2</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>13.1.
|
|
9
|
+
<version>13.1.2</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250411043200</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1d1153a5729357ad8f9e772856949317
|
package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
00c5a2afe77e230814818e9cec747ef40686fb87
|
package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
b70ffd552875d2929aa3104f4c21f97856bb841c976f1dd0e3337eed42b34997
|
package/local-maven-repo/host/exp/exponent/expo.modules.backgroundfetch/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
76ff6e41afd212cabcdeebf10456721c9ecfa1798bfdfcd317634f6d63b4941e5f34d1b3517dfaa7b8a830a59edaf5f296b68fdf2687999fee0bff245c25898a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-background-fetch",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.2",
|
|
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": "~13.1.
|
|
36
|
+
"expo-task-manager": "~13.1.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"expo-module-scripts": "^4.1.1"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"expo": "*"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "c81263062bf24ad09e51e019f1d7dc29fa651c55"
|
|
45
45
|
}
|
package/src/BackgroundFetch.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunningInExpoGo } from 'expo';
|
|
1
2
|
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
3
|
import * as TaskManager from 'expo-task-manager';
|
|
3
4
|
|
|
@@ -19,6 +20,23 @@ const showDeprecationWarning = () => {
|
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
22
|
|
|
23
|
+
let warnedAboutExpoGo = false;
|
|
24
|
+
|
|
25
|
+
function _validate(taskName: unknown) {
|
|
26
|
+
if (isRunningInExpoGo()) {
|
|
27
|
+
if (!warnedAboutExpoGo) {
|
|
28
|
+
const message =
|
|
29
|
+
'`Background Fetch` functionality is not available in Expo Go:\n' +
|
|
30
|
+
'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';
|
|
31
|
+
console.warn(message);
|
|
32
|
+
warnedAboutExpoGo = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!taskName || typeof taskName !== 'string') {
|
|
36
|
+
throw new TypeError('`taskName` must be a non-empty string.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
22
40
|
// @needsAudit
|
|
23
41
|
/**
|
|
24
42
|
* Gets a status of background fetch.
|
|
@@ -98,6 +116,7 @@ export async function registerTaskAsync(
|
|
|
98
116
|
`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`
|
|
99
117
|
);
|
|
100
118
|
}
|
|
119
|
+
_validate(taskName);
|
|
101
120
|
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
|
|
102
121
|
}
|
|
103
122
|
|
|
@@ -115,6 +134,7 @@ export async function unregisterTaskAsync(taskName: string): Promise<void> {
|
|
|
115
134
|
if (!ExpoBackgroundFetch.unregisterTaskAsync) {
|
|
116
135
|
throw new UnavailabilityError('BackgroundFetch', 'unregisterTaskAsync');
|
|
117
136
|
}
|
|
137
|
+
_validate(taskName);
|
|
118
138
|
await ExpoBackgroundFetch.unregisterTaskAsync(taskName);
|
|
119
139
|
}
|
|
120
140
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fa004d20e85e44fbaae7b75a3e304cd8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a3a4629aad9485c6867228eaf782759360603ea0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fba6e04580cb0af50fd4327a40c03b97bf1a3edae3acbea4c4d8324737ab4f4b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
47ec1d398aac0cdc7c7243ab0ecd46efadbbd5c6c9d10b67436d9d398e8f9b7995c137553bfa1c9d4a0bb27bf6d12756b505074c3eb654ac0b3745c2a5308f38
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
806383a7f3c149ef8563fdca4622de6e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6c582a74497e540c1b203ae393a78aa26844331d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bab9f1961ed255a11570b7b3917238dd3bdc5c64118744faaad601dcc24b01e7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
af3434c05e51d33f25c586c389b1e41fbc72fe8fb8cb6dd640fa215b3edd83d7ef0e7b4a9997e9a091191a88d1b2972adaf278f81c8b7aa67c4cc76465bdf90c
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|