expo-task-manager 13.1.1 → 13.1.3

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/android/build.gradle +2 -2
  3. package/build/TaskManager.d.ts.map +1 -1
  4. package/build/TaskManager.js +0 -16
  5. package/build/TaskManager.js.map +1 -1
  6. package/expo-module.config.json +1 -1
  7. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.module → 13.1.3/expo.modules.taskmanager-13.1.3.module} +8 -8
  8. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.module.md5 +1 -0
  9. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.module.sha1 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.module.sha256 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.module.sha512 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.pom → 13.1.3/expo.modules.taskmanager-13.1.3.pom} +2 -2
  13. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.pom.md5 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.pom.sha1 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.pom.sha256 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.3/expo.modules.taskmanager-13.1.3.pom.sha512 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/maven-metadata.xml +4 -4
  18. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/maven-metadata.xml.md5 +1 -1
  19. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/maven-metadata.xml.sha1 +1 -1
  20. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/maven-metadata.xml.sha256 +1 -1
  21. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/maven-metadata.xml.sha512 +1 -1
  22. package/package.json +4 -4
  23. package/src/TaskManager.ts +0 -18
  24. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.module.md5 +0 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.module.sha1 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.module.sha256 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.module.sha512 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.pom.md5 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.pom.sha1 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.pom.sha256 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/13.1.1/expo.modules.taskmanager-13.1.1.pom.sha512 +0 -1
  32. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1-sources.jar → 13.1.3/expo.modules.taskmanager-13.1.3-sources.jar} +0 -0
  33. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1-sources.jar.md5 → 13.1.3/expo.modules.taskmanager-13.1.3-sources.jar.md5} +0 -0
  34. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1-sources.jar.sha1 → 13.1.3/expo.modules.taskmanager-13.1.3-sources.jar.sha1} +0 -0
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1-sources.jar.sha256 → 13.1.3/expo.modules.taskmanager-13.1.3-sources.jar.sha256} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1-sources.jar.sha512 → 13.1.3/expo.modules.taskmanager-13.1.3-sources.jar.sha512} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.aar → 13.1.3/expo.modules.taskmanager-13.1.3.aar} +0 -0
  38. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.aar.md5 → 13.1.3/expo.modules.taskmanager-13.1.3.aar.md5} +0 -0
  39. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.aar.sha1 → 13.1.3/expo.modules.taskmanager-13.1.3.aar.sha1} +0 -0
  40. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.aar.sha256 → 13.1.3/expo.modules.taskmanager-13.1.3.aar.sha256} +0 -0
  41. /package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{13.1.1/expo.modules.taskmanager-13.1.1.aar.sha512 → 13.1.3/expo.modules.taskmanager-13.1.3.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 13.1.3 — 2025-04-14
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 13.1.2 — 2025-04-11
18
+
19
+ ### 💡 Others
20
+
21
+ - Removed warning about running on Expo Go. This is handled in packages using the Task Manager. ([#36038](https://github.com/expo/expo/pull/36038) by [@chrfalch](https://github.com/chrfalch))
22
+
13
23
  ## 13.1.1 — 2025-04-09
14
24
 
15
25
  _This version does not introduce any user-facing changes._
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '13.1.1'
7
+ version = '13.1.3'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.taskmanager"
11
11
  defaultConfig {
12
12
  versionCode 23
13
- versionName "13.1.1"
13
+ versionName "13.1.3"
14
14
  }
15
15
  }
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"TaskManager.d.ts","sourceRoot":"","sources":["../src/TaskManager.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC9C;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IAER;;OAEG;IACH,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,aAAa,EAAE,gCAAgC,CAAC;CACjD;AAGD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,UAAU,CAAC;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;CAAG;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AC,eAAe,EAAE,CAAC,CAM1E;AAGD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOzE;AAGD;;;;GAIG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7D;AAoCD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD"}
@@ -1,20 +1,7 @@
1
- import { isRunningInExpoGo } from 'expo';
2
1
  import { LegacyEventEmitter, UnavailabilityError } from 'expo-modules-core';
3
- import { Platform } from 'react-native';
4
2
  import ExpoTaskManager from './ExpoTaskManager';
5
3
  const tasks = new Map();
6
- let warnedAboutExpoGo = false;
7
4
  function _validate(taskName) {
8
- if (isRunningInExpoGo()) {
9
- if (!warnedAboutExpoGo) {
10
- const message = '`TaskManager` functionality is limited in Expo Go:\n' +
11
- 'On Android, it is not available at all.\n' +
12
- 'On iOS, it is limited to foreground execution.\n' +
13
- 'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';
14
- console.warn(message);
15
- warnedAboutExpoGo = true;
16
- }
17
- }
18
5
  if (!taskName || typeof taskName !== 'string') {
19
6
  throw new TypeError('`taskName` must be a non-empty string.');
20
7
  }
@@ -179,9 +166,6 @@ if (ExpoTaskManager) {
179
166
  * On the web, it always returns `false`.
180
167
  */
181
168
  export async function isAvailableAsync() {
182
- if (Platform.OS === 'android') {
183
- return !isRunningInExpoGo() && ExpoTaskManager.isAvailableAsync();
184
- }
185
169
  return ExpoTaskManager.isAvailableAsync();
186
170
  }
187
171
  //# sourceMappingURL=TaskManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskManager.js","sourceRoot":"","sources":["../src/TaskManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBA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ACnG,MAAM,eAAe,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,CAAC,iBAAiB,EAAE,IAAI,eAAe,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,eAAe,CAAC,gBAAgB,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport { LegacyEventEmitter, UnavailabilityError } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExpoTaskManager from './ExpoTaskManager';\n\n// @needsAudit @docsMissing\n/**\n * Error object that can be received through [`TaskManagerTaskBody`](#taskmanagertaskbody) when the\n * task fails.\n */\nexport interface TaskManagerError {\n code: string | number;\n message: string;\n}\n\n// @needsAudit\n/**\n * Represents the object that is passed to the task executor.\n */\nexport interface TaskManagerTaskBody<T = unknown> {\n /**\n * An object of data passed to the task executor. Its properties depend on the type of the task.\n */\n data: T;\n\n /**\n * Error object if the task failed or `null` otherwise.\n */\n error: TaskManagerError | null;\n\n /**\n * Additional details containing unique ID of task event and name of the task.\n */\n executionInfo: TaskManagerTaskBodyExecutionInfo;\n}\n\n// @needsAudit\n/**\n * Additional details about execution provided in `TaskManagerTaskBody`.\n */\nexport interface TaskManagerTaskBodyExecutionInfo {\n /**\n * State of the application.\n * @platform ios\n */\n appState?: 'active' | 'background' | 'inactive';\n /**\n * Unique ID of task event.\n */\n eventId: string;\n /**\n * Name of the task.\n */\n taskName: string;\n}\n\n// @needsAudit\n/**\n * Represents an already registered task.\n */\nexport interface TaskManagerTask {\n /**\n * Name that the task is registered with.\n */\n taskName: string;\n\n /**\n * Type of the task which depends on how the task was registered.\n */\n taskType: string;\n\n /**\n * Provides `options` that the task was registered with.\n */\n options: any;\n}\n\n/**\n * @deprecated Use `TaskManagerTask` instead.\n * @hidden\n */\nexport interface RegisteredTask extends TaskManagerTask {}\n\n// @needsAudit\n/**\n * Type of task executor – a function that handles the task.\n */\nexport type TaskManagerTaskExecutor<T = any> = (body: TaskManagerTaskBody<T>) => Promise<any>;\n\nconst tasks: Map<string, TaskManagerTaskExecutor<any>> = new Map<\n string,\n TaskManagerTaskExecutor<any>\n>();\n\nlet warnedAboutExpoGo = false;\n\nfunction _validate(taskName: unknown) {\n if (isRunningInExpoGo()) {\n if (!warnedAboutExpoGo) {\n const message =\n '`TaskManager` functionality is limited in Expo Go:\\n' +\n 'On Android, it is not available at all.\\n' +\n 'On iOS, it is limited to foreground execution.\\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 * Defines task function. It must be called in the global scope of your JavaScript bundle.\n * In particular, it cannot be called in any of React lifecycle methods like `componentDidMount`.\n * This limitation is due to the fact that when the application is launched in the background,\n * we need to spin up your JavaScript app, run your task and then shut down — no views are mounted\n * in this scenario.\n *\n * @param taskName Name of the task. It must be the same as the name you provided when registering the task.\n * @param taskExecutor A function that will be invoked when the task with given `taskName` is executed.\n */\nexport function defineTask<T = unknown>(\n taskName: string,\n taskExecutor: TaskManagerTaskExecutor<T>\n) {\n if (!taskName || typeof taskName !== 'string') {\n console.warn(`TaskManager.defineTask: 'taskName' argument must be a non-empty string.`);\n return;\n }\n if (!taskExecutor || typeof taskExecutor !== 'function') {\n console.warn(`TaskManager.defineTask: 'task' argument must be a function.`);\n return;\n }\n tasks.set(taskName, taskExecutor);\n}\n\n// @needsAudit\n/**\n * Checks whether the task is already defined.\n *\n * @param taskName Name of the task.\n */\nexport function isTaskDefined(taskName: string): boolean {\n return tasks.has(taskName);\n}\n\n// @needsAudit\n/**\n * Determine whether the task is registered. Registered tasks are stored in a persistent storage and\n * preserved between sessions.\n *\n * @param taskName Name of the task.\n * @returns A promise which resolves to `true` if a task with the given name is registered, otherwise `false`.\n */\nexport async function isTaskRegisteredAsync(taskName: string): Promise<boolean> {\n if (!ExpoTaskManager.isTaskRegisteredAsync) {\n throw new UnavailabilityError('TaskManager', 'isTaskRegisteredAsync');\n }\n\n _validate(taskName);\n return ExpoTaskManager.isTaskRegisteredAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Retrieves `options` associated with the task, that were passed to the function registering the task\n * (e.g. `Location.startLocationUpdatesAsync`).\n *\n * @param taskName Name of the task.\n * @return A promise which fulfills with the `options` object that was passed while registering task\n * with given name or `null` if task couldn't be found.\n */\nexport async function getTaskOptionsAsync<TaskOptions>(taskName: string): Promise<TaskOptions> {\n if (!ExpoTaskManager.getTaskOptionsAsync) {\n throw new UnavailabilityError('TaskManager', 'getTaskOptionsAsync');\n }\n\n _validate(taskName);\n return ExpoTaskManager.getTaskOptionsAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Provides information about tasks registered in the app.\n *\n * @returns A promise which fulfills with an array of tasks registered in the app.\n * @example\n * ```js\n * [\n * {\n * taskName: 'location-updates-task-name',\n * taskType: 'location',\n * options: {\n * accuracy: Location.Accuracy.High,\n * showsBackgroundLocationIndicator: false,\n * },\n * },\n * {\n * taskName: 'geofencing-task-name',\n * taskType: 'geofencing',\n * options: {\n * regions: [...],\n * },\n * },\n * ]\n * ```\n */\nexport async function getRegisteredTasksAsync(): Promise<TaskManagerTask[]> {\n if (!ExpoTaskManager.getRegisteredTasksAsync) {\n throw new UnavailabilityError('TaskManager', 'getRegisteredTasksAsync');\n }\n\n return ExpoTaskManager.getRegisteredTasksAsync();\n}\n\n// @needsAudit\n/**\n * Unregisters task from the app, so the app will not be receiving updates for that task anymore.\n * _It is recommended to use methods specialized by modules that registered the task, eg.\n * [`Location.stopLocationUpdatesAsync`](./location/#expolocationstoplocationupdatesasynctaskname)._\n *\n * @param taskName Name of the task to unregister.\n * @return A promise which fulfills as soon as the task is unregistered.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n if (!ExpoTaskManager.unregisterTaskAsync) {\n throw new UnavailabilityError('TaskManager', 'unregisterTaskAsync');\n }\n\n _validate(taskName);\n await ExpoTaskManager.unregisterTaskAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Unregisters all tasks registered for the running app. You may want to call this when the user is\n * signing out and you no longer need to track his location or run any other background tasks.\n * @return A promise which fulfills as soon as all tasks are completely unregistered.\n */\nexport async function unregisterAllTasksAsync(): Promise<void> {\n if (!ExpoTaskManager.unregisterAllTasksAsync) {\n throw new UnavailabilityError('TaskManager', 'unregisterAllTasksAsync');\n }\n\n await ExpoTaskManager.unregisterAllTasksAsync();\n}\n\nif (ExpoTaskManager) {\n const eventEmitter = new LegacyEventEmitter(ExpoTaskManager);\n eventEmitter.addListener<TaskManagerTaskBody>(\n ExpoTaskManager.EVENT_NAME,\n async ({ data, error, executionInfo }) => {\n const { eventId, taskName } = executionInfo;\n const taskExecutor = tasks.get(taskName);\n let result: any = null;\n\n if (taskExecutor) {\n try {\n // Execute JS task\n result = await taskExecutor({ data, error, executionInfo });\n } catch (error) {\n console.error(`TaskManager: Task \"${taskName}\" failed:`, error);\n } finally {\n // Notify manager the task is finished.\n await ExpoTaskManager.notifyTaskFinishedAsync(taskName, { eventId, result });\n }\n } else {\n console.warn(\n `TaskManager: Task \"${taskName}\" has been executed but looks like it is not defined. Please make sure that \"TaskManager.defineTask\" is called during initialization phase.`\n );\n // No tasks defined -> we need to notify about finish anyway.\n await ExpoTaskManager.notifyTaskFinishedAsync(taskName, { eventId, result });\n // We should also unregister such tasks automatically as the task might have been removed\n // from the app or just renamed - in that case it needs to be registered again (with the new name).\n await ExpoTaskManager.unregisterTaskAsync(taskName);\n }\n }\n );\n}\n\n// @needsAudit\n/**\n * Determine if the `TaskManager` API can be used in this app.\n * @return A promise which fulfills with `true` if the API can be used, and `false` otherwise.\n * With Expo Go, `TaskManager` is not available on Android, and does not support background execution on iOS.\n * Use a development build to avoid limitations: https://expo.fyi/dev-client.\n * On the web, it always returns `false`.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (Platform.OS === 'android') {\n return !isRunningInExpoGo() && ExpoTaskManager.isAvailableAsync();\n }\n return ExpoTaskManager.isAvailableAsync();\n}\n"]}
1
+ {"version":3,"file":"TaskManager.js","sourceRoot":"","sources":["../src/TaskManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE5E,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAsFhD,MAAM,KAAK,GAA8C,IAAI,GAAG,EAG7D,CAAC;AAEJ,SAAS,SAAS,CAAC,QAAiB;IAClC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,cAAc;AACd;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,YAAwC;IAExC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QACxF,OAAO;IACT,CAAC;IACD,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAED,cAAc;AACd;;;;;;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GAAmG;YACnG,MAAM,eAAe,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,OAAO,eAAe,CAAC,gBAAgB,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { LegacyEventEmitter, UnavailabilityError } from 'expo-modules-core';\n\nimport ExpoTaskManager from './ExpoTaskManager';\n\n// @needsAudit @docsMissing\n/**\n * Error object that can be received through [`TaskManagerTaskBody`](#taskmanagertaskbody) when the\n * task fails.\n */\nexport interface TaskManagerError {\n code: string | number;\n message: string;\n}\n\n// @needsAudit\n/**\n * Represents the object that is passed to the task executor.\n */\nexport interface TaskManagerTaskBody<T = unknown> {\n /**\n * An object of data passed to the task executor. Its properties depend on the type of the task.\n */\n data: T;\n\n /**\n * Error object if the task failed or `null` otherwise.\n */\n error: TaskManagerError | null;\n\n /**\n * Additional details containing unique ID of task event and name of the task.\n */\n executionInfo: TaskManagerTaskBodyExecutionInfo;\n}\n\n// @needsAudit\n/**\n * Additional details about execution provided in `TaskManagerTaskBody`.\n */\nexport interface TaskManagerTaskBodyExecutionInfo {\n /**\n * State of the application.\n * @platform ios\n */\n appState?: 'active' | 'background' | 'inactive';\n /**\n * Unique ID of task event.\n */\n eventId: string;\n /**\n * Name of the task.\n */\n taskName: string;\n}\n\n// @needsAudit\n/**\n * Represents an already registered task.\n */\nexport interface TaskManagerTask {\n /**\n * Name that the task is registered with.\n */\n taskName: string;\n\n /**\n * Type of the task which depends on how the task was registered.\n */\n taskType: string;\n\n /**\n * Provides `options` that the task was registered with.\n */\n options: any;\n}\n\n/**\n * @deprecated Use `TaskManagerTask` instead.\n * @hidden\n */\nexport interface RegisteredTask extends TaskManagerTask {}\n\n// @needsAudit\n/**\n * Type of task executor – a function that handles the task.\n */\nexport type TaskManagerTaskExecutor<T = any> = (body: TaskManagerTaskBody<T>) => Promise<any>;\n\nconst tasks: Map<string, TaskManagerTaskExecutor<any>> = new Map<\n string,\n TaskManagerTaskExecutor<any>\n>();\n\nfunction _validate(taskName: unknown) {\n if (!taskName || typeof taskName !== 'string') {\n throw new TypeError('`taskName` must be a non-empty string.');\n }\n}\n\n// @needsAudit\n/**\n * Defines task function. It must be called in the global scope of your JavaScript bundle.\n * In particular, it cannot be called in any of React lifecycle methods like `componentDidMount`.\n * This limitation is due to the fact that when the application is launched in the background,\n * we need to spin up your JavaScript app, run your task and then shut down — no views are mounted\n * in this scenario.\n *\n * @param taskName Name of the task. It must be the same as the name you provided when registering the task.\n * @param taskExecutor A function that will be invoked when the task with given `taskName` is executed.\n */\nexport function defineTask<T = unknown>(\n taskName: string,\n taskExecutor: TaskManagerTaskExecutor<T>\n) {\n if (!taskName || typeof taskName !== 'string') {\n console.warn(`TaskManager.defineTask: 'taskName' argument must be a non-empty string.`);\n return;\n }\n if (!taskExecutor || typeof taskExecutor !== 'function') {\n console.warn(`TaskManager.defineTask: 'task' argument must be a function.`);\n return;\n }\n tasks.set(taskName, taskExecutor);\n}\n\n// @needsAudit\n/**\n * Checks whether the task is already defined.\n *\n * @param taskName Name of the task.\n */\nexport function isTaskDefined(taskName: string): boolean {\n return tasks.has(taskName);\n}\n\n// @needsAudit\n/**\n * Determine whether the task is registered. Registered tasks are stored in a persistent storage and\n * preserved between sessions.\n *\n * @param taskName Name of the task.\n * @returns A promise which resolves to `true` if a task with the given name is registered, otherwise `false`.\n */\nexport async function isTaskRegisteredAsync(taskName: string): Promise<boolean> {\n if (!ExpoTaskManager.isTaskRegisteredAsync) {\n throw new UnavailabilityError('TaskManager', 'isTaskRegisteredAsync');\n }\n\n _validate(taskName);\n return ExpoTaskManager.isTaskRegisteredAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Retrieves `options` associated with the task, that were passed to the function registering the task\n * (e.g. `Location.startLocationUpdatesAsync`).\n *\n * @param taskName Name of the task.\n * @return A promise which fulfills with the `options` object that was passed while registering task\n * with given name or `null` if task couldn't be found.\n */\nexport async function getTaskOptionsAsync<TaskOptions>(taskName: string): Promise<TaskOptions> {\n if (!ExpoTaskManager.getTaskOptionsAsync) {\n throw new UnavailabilityError('TaskManager', 'getTaskOptionsAsync');\n }\n\n _validate(taskName);\n return ExpoTaskManager.getTaskOptionsAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Provides information about tasks registered in the app.\n *\n * @returns A promise which fulfills with an array of tasks registered in the app.\n * @example\n * ```js\n * [\n * {\n * taskName: 'location-updates-task-name',\n * taskType: 'location',\n * options: {\n * accuracy: Location.Accuracy.High,\n * showsBackgroundLocationIndicator: false,\n * },\n * },\n * {\n * taskName: 'geofencing-task-name',\n * taskType: 'geofencing',\n * options: {\n * regions: [...],\n * },\n * },\n * ]\n * ```\n */\nexport async function getRegisteredTasksAsync(): Promise<TaskManagerTask[]> {\n if (!ExpoTaskManager.getRegisteredTasksAsync) {\n throw new UnavailabilityError('TaskManager', 'getRegisteredTasksAsync');\n }\n\n return ExpoTaskManager.getRegisteredTasksAsync();\n}\n\n// @needsAudit\n/**\n * Unregisters task from the app, so the app will not be receiving updates for that task anymore.\n * _It is recommended to use methods specialized by modules that registered the task, eg.\n * [`Location.stopLocationUpdatesAsync`](./location/#expolocationstoplocationupdatesasynctaskname)._\n *\n * @param taskName Name of the task to unregister.\n * @return A promise which fulfills as soon as the task is unregistered.\n */\nexport async function unregisterTaskAsync(taskName: string): Promise<void> {\n if (!ExpoTaskManager.unregisterTaskAsync) {\n throw new UnavailabilityError('TaskManager', 'unregisterTaskAsync');\n }\n\n _validate(taskName);\n await ExpoTaskManager.unregisterTaskAsync(taskName);\n}\n\n// @needsAudit\n/**\n * Unregisters all tasks registered for the running app. You may want to call this when the user is\n * signing out and you no longer need to track his location or run any other background tasks.\n * @return A promise which fulfills as soon as all tasks are completely unregistered.\n */\nexport async function unregisterAllTasksAsync(): Promise<void> {\n if (!ExpoTaskManager.unregisterAllTasksAsync) {\n throw new UnavailabilityError('TaskManager', 'unregisterAllTasksAsync');\n }\n\n await ExpoTaskManager.unregisterAllTasksAsync();\n}\n\nif (ExpoTaskManager) {\n const eventEmitter = new LegacyEventEmitter(ExpoTaskManager);\n eventEmitter.addListener<TaskManagerTaskBody>(\n ExpoTaskManager.EVENT_NAME,\n async ({ data, error, executionInfo }) => {\n const { eventId, taskName } = executionInfo;\n const taskExecutor = tasks.get(taskName);\n let result: any = null;\n\n if (taskExecutor) {\n try {\n // Execute JS task\n result = await taskExecutor({ data, error, executionInfo });\n } catch (error) {\n console.error(`TaskManager: Task \"${taskName}\" failed:`, error);\n } finally {\n // Notify manager the task is finished.\n await ExpoTaskManager.notifyTaskFinishedAsync(taskName, { eventId, result });\n }\n } else {\n console.warn(\n `TaskManager: Task \"${taskName}\" has been executed but looks like it is not defined. Please make sure that \"TaskManager.defineTask\" is called during initialization phase.`\n );\n // No tasks defined -> we need to notify about finish anyway.\n await ExpoTaskManager.notifyTaskFinishedAsync(taskName, { eventId, result });\n // We should also unregister such tasks automatically as the task might have been removed\n // from the app or just renamed - in that case it needs to be registered again (with the new name).\n await ExpoTaskManager.unregisterTaskAsync(taskName);\n }\n }\n );\n}\n\n// @needsAudit\n/**\n * Determine if the `TaskManager` API can be used in this app.\n * @return A promise which fulfills with `true` if the API can be used, and `false` otherwise.\n * With Expo Go, `TaskManager` is not available on Android, and does not support background execution on iOS.\n * Use a development build to avoid limitations: https://expo.fyi/dev-client.\n * On the web, it always returns `false`.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return ExpoTaskManager.isAvailableAsync();\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "publication": {
6
6
  "groupId": "host.exp.exponent",
7
7
  "artifactId": "expo.modules.taskmanager",
8
- "version": "13.1.1",
8
+ "version": "13.1.3",
9
9
  "repository": "local-maven-repo"
10
10
  }
11
11
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.taskmanager",
6
- "version": "13.1.1",
6
+ "version": "13.1.3",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -33,8 +33,8 @@
33
33
  ],
34
34
  "files": [
35
35
  {
36
- "name": "expo.modules.taskmanager-13.1.1.aar",
37
- "url": "expo.modules.taskmanager-13.1.1.aar",
36
+ "name": "expo.modules.taskmanager-13.1.3.aar",
37
+ "url": "expo.modules.taskmanager-13.1.3.aar",
38
38
  "size": 63647,
39
39
  "sha512": "f282febd40d99e24dad10a6c39f4d23f6f2ce6cd8fca8cd96a9b69466ac216dec13a2c38a349edff5f6945bdc7b445e7ab51dc65b08dc1f75997de322bede3e5",
40
40
  "sha256": "c546abef6b44daeb1b14b706b58f077a960a939503833b740a7892e924d34c6c",
@@ -63,7 +63,7 @@
63
63
  "group": "host.exp.exponent",
64
64
  "module": "org.unimodules.apploader",
65
65
  "version": {
66
- "requires": "5.1.0"
66
+ "requires": "5.1.1"
67
67
  }
68
68
  },
69
69
  {
@@ -76,8 +76,8 @@
76
76
  ],
77
77
  "files": [
78
78
  {
79
- "name": "expo.modules.taskmanager-13.1.1.aar",
80
- "url": "expo.modules.taskmanager-13.1.1.aar",
79
+ "name": "expo.modules.taskmanager-13.1.3.aar",
80
+ "url": "expo.modules.taskmanager-13.1.3.aar",
81
81
  "size": 63647,
82
82
  "sha512": "f282febd40d99e24dad10a6c39f4d23f6f2ce6cd8fca8cd96a9b69466ac216dec13a2c38a349edff5f6945bdc7b445e7ab51dc65b08dc1f75997de322bede3e5",
83
83
  "sha256": "c546abef6b44daeb1b14b706b58f077a960a939503833b740a7892e924d34c6c",
@@ -96,8 +96,8 @@
96
96
  },
97
97
  "files": [
98
98
  {
99
- "name": "expo.modules.taskmanager-13.1.1-sources.jar",
100
- "url": "expo.modules.taskmanager-13.1.1-sources.jar",
99
+ "name": "expo.modules.taskmanager-13.1.3-sources.jar",
100
+ "url": "expo.modules.taskmanager-13.1.3-sources.jar",
101
101
  "size": 22646,
102
102
  "sha512": "25b133bdad577f284d63352db16d3c9ed568580b22025b82b89c785bc97e5f41be6121ec684dcf9ceb75334e71320bf7286ee7dac8b9a1f696a23fd7b0ece253",
103
103
  "sha256": "1442b216d440eff8ac27579247ee8750e04165823171fd60b1779d2ae991d0c2",
@@ -0,0 +1 @@
1
+ f519feaebdbfda2fd103c368ddec242f1b3f021d84e9e5fa6be0d1b93889794d
@@ -0,0 +1 @@
1
+ 74ddd8a6ccb90676afb9c5f179dae95838356421e231d51ece916a130484a2a071ebe3f8ff8e65aabbc35b42dabc1fd1249f87844a5fc5abe1ca5d955c75c77a
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.taskmanager</artifactId>
12
- <version>13.1.1</version>
12
+ <version>13.1.3</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.taskmanager</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -40,7 +40,7 @@
40
40
  <dependency>
41
41
  <groupId>host.exp.exponent</groupId>
42
42
  <artifactId>org.unimodules.apploader</artifactId>
43
- <version>5.1.0</version>
43
+ <version>5.1.1</version>
44
44
  <scope>runtime</scope>
45
45
  </dependency>
46
46
  </dependencies>
@@ -0,0 +1 @@
1
+ a39dfb4fe70e5dfecaf6b6b86bfe4855e13def973d710753a6be970466f30c07
@@ -0,0 +1 @@
1
+ 0e588a34254187c38f4798499c603b1cba2e0942cd62545a9a04f4475dd9f17da7d87e0da4a3800c0c7938dd2ac0d6e36ae2b66af8aec61adb8e373f73b4035f
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.taskmanager</artifactId>
5
5
  <versioning>
6
- <latest>13.1.1</latest>
7
- <release>13.1.1</release>
6
+ <latest>13.1.3</latest>
7
+ <release>13.1.3</release>
8
8
  <versions>
9
- <version>13.1.1</version>
9
+ <version>13.1.3</version>
10
10
  </versions>
11
- <lastUpdated>20250409202759</lastUpdated>
11
+ <lastUpdated>20250414185043</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 5b74a163b30c0cd943ffd8e98be3a5c6
1
+ 874e6da2819f46bf0a6806969f11fb26
@@ -1 +1 @@
1
- d4a1fc73e1e2fa0e9719df4f243e10e19919d868
1
+ 4414f72d8d7f0e8f499b6f3cb7accf1089ba0c92
@@ -1 +1 @@
1
- bd378a521d1721d97c08d6a80b5b0d7b6d908d385cbdb0d4d35f51b7ad1273fe
1
+ cf3a7489df07dfa35b3f162450c2a7a97db7ea33f7f633cba7742f1350349ad5
@@ -1 +1 @@
1
- e7c9ace53d1a4e9c5eea48a2087bd0ad14ed52eafe6f9f800c1f9a02bebb83527e124fe8f2c5e729baf90ea31bc514d50ed252b6f65348ff9d15d00537dfdb04
1
+ f9d3394e0f5de9f3f46ff58ac4d22ebdfcfed5f31bbad751c2236127f70e1071afc7e062a06969db2e7d6c05b26c017b912ec166613a954246124c9642516ce9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-task-manager",
3
- "version": "13.1.1",
3
+ "version": "13.1.3",
4
4
  "description": "Expo module that provides support for tasks that can run in the background.",
5
5
  "main": "build/TaskManager.js",
6
6
  "types": "build/TaskManager.d.ts",
@@ -33,14 +33,14 @@
33
33
  "license": "MIT",
34
34
  "homepage": "https://docs.expo.dev/versions/latest/sdk/task-manager/",
35
35
  "dependencies": {
36
- "unimodules-app-loader": "~5.1.0"
36
+ "unimodules-app-loader": "~5.1.1"
37
37
  },
38
38
  "devDependencies": {
39
- "expo-module-scripts": "^4.1.1"
39
+ "expo-module-scripts": "^4.1.2"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "expo": "*",
43
43
  "react-native": "*"
44
44
  },
45
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
45
+ "gitHead": "cb9fdd93f76f28e2ace4f66080b2386d87239553"
46
46
  }
@@ -1,6 +1,4 @@
1
- import { isRunningInExpoGo } from 'expo';
2
1
  import { LegacyEventEmitter, UnavailabilityError } from 'expo-modules-core';
3
- import { Platform } from 'react-native';
4
2
 
5
3
  import ExpoTaskManager from './ExpoTaskManager';
6
4
 
@@ -93,20 +91,7 @@ const tasks: Map<string, TaskManagerTaskExecutor<any>> = new Map<
93
91
  TaskManagerTaskExecutor<any>
94
92
  >();
95
93
 
96
- let warnedAboutExpoGo = false;
97
-
98
94
  function _validate(taskName: unknown) {
99
- if (isRunningInExpoGo()) {
100
- if (!warnedAboutExpoGo) {
101
- const message =
102
- '`TaskManager` functionality is limited in Expo Go:\n' +
103
- 'On Android, it is not available at all.\n' +
104
- 'On iOS, it is limited to foreground execution.\n' +
105
- 'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';
106
- console.warn(message);
107
- warnedAboutExpoGo = true;
108
- }
109
- }
110
95
  if (!taskName || typeof taskName !== 'string') {
111
96
  throw new TypeError('`taskName` must be a non-empty string.');
112
97
  }
@@ -291,8 +276,5 @@ if (ExpoTaskManager) {
291
276
  * On the web, it always returns `false`.
292
277
  */
293
278
  export async function isAvailableAsync(): Promise<boolean> {
294
- if (Platform.OS === 'android') {
295
- return !isRunningInExpoGo() && ExpoTaskManager.isAvailableAsync();
296
- }
297
279
  return ExpoTaskManager.isAvailableAsync();
298
280
  }
@@ -1 +0,0 @@
1
- 7d13d8e218cd4d3cdc6bcd9a38191474c4444029ef7c20d06fc82bbf88284d9e
@@ -1 +0,0 @@
1
- ee51cb527db472dd50392f1baccc137c8c7b042eea59b624e058f874e56acb98b82c56ada33d6a25ecfb6345a27c0c0a5a92242e04e56ad162ad9da059530b90
@@ -1 +0,0 @@
1
- da5caeb66d4d3a8ecc1ace187ffa59fc187f5e3244180c818913bba044fbdbae
@@ -1 +0,0 @@
1
- fca7e8b46b89af20cd52f379c09a6a04a441fa001d6b683c612901384592a70d0577fb04a188c17c375ea76505cf8ec14b7c6a954c1524ad7d1fc41607ef5263