expo-background-fetch 11.3.0 → 11.5.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,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 11.5.0 — 2023-09-04
14
+
15
+ ### 🎉 New features
16
+
17
+ - Added support for React Native 0.73. ([#24018](https://github.com/expo/expo/pull/24018) by [@kudo](https://github.com/kudo))
18
+
19
+ ### 💡 Others
20
+
21
+ - Migrated Android codebase to use Expo modules API. ([#23903](https://github.com/expo/expo/pull/23903) by [@lukmccall](https://github.com/lukmccall))
22
+
23
+ ## 11.4.0 — 2023-08-02
24
+
25
+ _This version does not introduce any user-facing changes._
26
+
13
27
  ## 11.3.0 — 2023-06-21
14
28
 
15
29
  ### 🐛 Bug fixes
@@ -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.3.0'
6
+ version = '11.5.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -53,13 +53,16 @@ afterEvaluate {
53
53
  android {
54
54
  compileSdkVersion safeExtGet("compileSdkVersion", 33)
55
55
 
56
- compileOptions {
57
- sourceCompatibility JavaVersion.VERSION_11
58
- targetCompatibility JavaVersion.VERSION_11
59
- }
56
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
+ if (agpVersion.tokenize('.')[0].toInteger() < 8) {
58
+ compileOptions {
59
+ sourceCompatibility JavaVersion.VERSION_11
60
+ targetCompatibility JavaVersion.VERSION_11
61
+ }
60
62
 
61
- kotlinOptions {
62
- jvmTarget = JavaVersion.VERSION_11.majorVersion
63
+ kotlinOptions {
64
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
65
+ }
63
66
  }
64
67
 
65
68
  namespace "expo.modules.backgroundfetch"
@@ -67,7 +70,7 @@ android {
67
70
  minSdkVersion safeExtGet("minSdkVersion", 21)
68
71
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
69
72
  versionCode 23
70
- versionName "11.3.0"
73
+ versionName "11.5.0"
71
74
  }
72
75
  lintOptions {
73
76
  abortOnError false
@@ -0,0 +1,26 @@
1
+ package expo.modules.backgroundfetch
2
+
3
+ import expo.modules.interfaces.taskManager.TaskManagerInterface
4
+ import expo.modules.kotlin.exception.CodedException
5
+ import expo.modules.kotlin.modules.Module
6
+ import expo.modules.kotlin.modules.ModuleDefinition
7
+
8
+ class TaskMangerInterfaceNotFoundException : CodedException(message = "TaskManagerInterface not found")
9
+
10
+ class BackgroundFetchModule : Module() {
11
+ private val _taskManager by lazy { appContext.legacyModule<TaskManagerInterface>() }
12
+ private val taskManager: TaskManagerInterface
13
+ get() = _taskManager ?: throw TaskMangerInterfaceNotFoundException()
14
+
15
+ override fun definition() = ModuleDefinition {
16
+ Name("ExpoBackgroundFetch")
17
+
18
+ AsyncFunction("registerTaskAsync") { taskName: String, options: Map<String, Any?> ->
19
+ taskManager.registerTask(taskName, BackgroundFetchTaskConsumer::class.java, options)
20
+ }
21
+
22
+ AsyncFunction("unregisterTaskAsync") { taskName: String ->
23
+ taskManager.unregisterTask(taskName, BackgroundFetchTaskConsumer::class.java)
24
+ }
25
+ }
26
+ }
@@ -1,3 +1,3 @@
1
- declare const _default: import("expo-modules-core").ProxyNativeModule;
1
+ declare const _default: any;
2
2
  export default _default;
3
3
  //# sourceMappingURL=ExpoBackgroundFetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoBackgroundFetch.d.ts","sourceRoot":"","sources":["../src/ExpoBackgroundFetch.ts"],"names":[],"mappings":";AAEA,wBAAsD"}
1
+ {"version":3,"file":"ExpoBackgroundFetch.d.ts","sourceRoot":"","sources":["../src/ExpoBackgroundFetch.ts"],"names":[],"mappings":";AAEA,wBAA0D"}
@@ -1,3 +1,3 @@
1
- import { NativeModulesProxy } from 'expo-modules-core';
2
- export default NativeModulesProxy.ExpoBackgroundFetch;
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ export default requireNativeModule('ExpoBackgroundFetch');
3
3
  //# sourceMappingURL=ExpoBackgroundFetch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoBackgroundFetch.js","sourceRoot":"","sources":["../src/ExpoBackgroundFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAe,kBAAkB,CAAC,mBAAmB,CAAC","sourcesContent":["import { NativeModulesProxy } from 'expo-modules-core';\n\nexport default NativeModulesProxy.ExpoBackgroundFetch;\n"]}
1
+ {"version":3,"file":"ExpoBackgroundFetch.js","sourceRoot":"","sources":["../src/ExpoBackgroundFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAe,mBAAmB,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nexport default requireNativeModule('ExpoBackgroundFetch');\n"]}
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "expo-background-fetch",
3
+ "platforms": ["ios", "android"],
4
+ "android": {
5
+ "modules": ["expo.modules.backgroundfetch.BackgroundFetchModule"]
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-background-fetch",
3
- "version": "11.3.0",
3
+ "version": "11.5.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.3.0"
36
+ "expo-task-manager": "~11.5.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": "fa5ecca8251986b9f197cc14074eec0ab6dfb6db"
44
+ "gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
45
45
  }
@@ -1,3 +1,3 @@
1
- import { NativeModulesProxy } from 'expo-modules-core';
1
+ import { requireNativeModule } from 'expo-modules-core';
2
2
 
3
- export default NativeModulesProxy.ExpoBackgroundFetch;
3
+ export default requireNativeModule('ExpoBackgroundFetch');
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
9
  }
@@ -1,49 +0,0 @@
1
- package expo.modules.backgroundfetch;
2
-
3
- import android.content.Context;
4
-
5
- import java.util.Map;
6
-
7
- import expo.modules.core.ExportedModule;
8
- import expo.modules.core.ModuleRegistry;
9
- import expo.modules.core.Promise;
10
- import expo.modules.core.interfaces.ExpoMethod;
11
- import expo.modules.interfaces.taskManager.TaskManagerInterface;
12
-
13
- class BackgroundFetchModule extends ExportedModule {
14
- private TaskManagerInterface mTaskManager;
15
-
16
- public BackgroundFetchModule(Context context) {
17
- super(context);
18
- }
19
-
20
- @Override
21
- public String getName() {
22
- return "ExpoBackgroundFetch";
23
- }
24
-
25
- @Override
26
- public void onCreate(ModuleRegistry moduleRegistry) {
27
- mTaskManager = moduleRegistry.getModule(TaskManagerInterface.class);
28
- }
29
-
30
- @ExpoMethod
31
- public void registerTaskAsync(String taskName, Map<String, Object> options, final Promise promise) {
32
- try {
33
- mTaskManager.registerTask(taskName, BackgroundFetchTaskConsumer.class, options);
34
- promise.resolve(null);
35
- } catch (Exception e) {
36
- promise.reject(e);
37
- }
38
- }
39
-
40
- @ExpoMethod
41
- public void unregisterTaskAsync(String taskName, final Promise promise) {
42
- try {
43
- mTaskManager.unregisterTask(taskName, BackgroundFetchTaskConsumer.class);
44
- promise.resolve(null);
45
- } catch (Exception e) {
46
- promise.reject(e);
47
- }
48
- }
49
- }
@@ -1,16 +0,0 @@
1
- package expo.modules.backgroundfetch;
2
-
3
- import android.content.Context;
4
-
5
- import java.util.Collections;
6
- import java.util.List;
7
-
8
- import expo.modules.core.BasePackage;
9
- import expo.modules.core.ExportedModule;
10
-
11
- public class BackgroundFetchPackage extends BasePackage {
12
- @Override
13
- public List<ExportedModule> createExportedModules(Context context) {
14
- return Collections.singletonList((ExportedModule) new BackgroundFetchModule(context));
15
- }
16
- }
package/unimodule.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "name": "expo-background-fetch",
3
- "platforms": ["ios", "android"]
4
- }