expo-modules-core 0.6.1 → 0.6.5

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,30 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.6.5 — 2022-02-01
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 0.6.4 — 2022-01-05
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Fix `ReactInstanceManager.onHostPause` exception from moving Android apps to background. ([#15748](https://github.com/expo/expo/pull/15748) by [@kudo](https://github.com/kudo))
24
+
25
+ ## 0.6.3 — 2021-12-16
26
+
27
+ ### 🐛 Bug fixes
28
+
29
+ - Fixed the deep link wasn't passed to the application if the application wasn't running when the deep link was sent. ([#15593](https://github.com/expo/expo/pull/15593) by [@lukmccall](https://github.com/lukmccall))
30
+
31
+ ## 0.6.2 — 2021-12-15
32
+
33
+ ### 🎉 New features
34
+
35
+ - Add `onNewIntent` and `onBackPressed` support to `ReactActivityLifecycleListener`. ([#15550](https://github.com/expo/expo/pull/15550) by [@Kudo](https://github.com/Kudo))
36
+
13
37
  ## 0.6.1 — 2021-12-08
14
38
 
15
39
  _This version does not introduce any user-facing changes._
@@ -1,9 +1,9 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.6.1'
6
+ version = '0.6.5'
7
7
 
8
8
  buildscript {
9
9
  // Simple helper that allows the root project to override versions declared by this library.
@@ -20,27 +20,25 @@ buildscript {
20
20
  }
21
21
  }
22
22
 
23
- //Upload android library to maven with javadoc and android sources
24
- configurations {
25
- deployerJars
26
- }
27
-
28
- //Creating sources with comments
23
+ // Creating sources with comments
29
24
  task androidSourcesJar(type: Jar) {
30
25
  classifier = 'sources'
31
26
  from android.sourceSets.main.java.srcDirs
32
27
  }
33
28
 
34
- //Put the androidSources and javadoc to the artifacts
35
- artifacts {
36
- archives androidSourcesJar
37
- }
38
-
39
- uploadArchives {
40
- repositories {
41
- mavenDeployer {
42
- configuration = configurations.deployerJars
43
- repository(url: mavenLocal().url)
29
+ afterEvaluate {
30
+ publishing {
31
+ publications {
32
+ release(MavenPublication) {
33
+ from components.release
34
+ // Add additional sourcesJar to artifacts
35
+ artifact(androidSourcesJar)
36
+ }
37
+ }
38
+ repositories {
39
+ maven {
40
+ url = mavenLocal().url
41
+ }
44
42
  }
45
43
  }
46
44
  }
@@ -58,7 +56,7 @@ android {
58
56
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
59
57
  consumerProguardFiles 'proguard-rules.pro'
60
58
  versionCode 1
61
- versionName "0.6.1"
59
+ versionName "0.6.5"
62
60
  }
63
61
  lintOptions {
64
62
  abortOnError false
@@ -3,6 +3,7 @@ package expo.modules.adapters.react.apploader
3
3
  import android.content.Context
4
4
  import com.facebook.react.ReactApplication
5
5
  import com.facebook.react.ReactInstanceManager
6
+ import com.facebook.react.common.LifecycleState
6
7
  import expo.modules.apploader.HeadlessAppLoader
7
8
  import expo.modules.core.interfaces.Consumer
8
9
  import expo.modules.core.interfaces.DoNotStrip
@@ -43,7 +44,12 @@ class RNHeadlessAppLoader @DoNotStrip constructor(private val context: Context)
43
44
  return if (appRecords.containsKey(appScopeKey) && appRecords[appScopeKey] != null) {
44
45
  val appRecord: ReactInstanceManager = appRecords[appScopeKey]!!
45
46
  android.os.Handler(context.mainLooper).post {
46
- appRecord.destroy()
47
+ // Only destroy the `ReactInstanceManager` if it does not bind with an Activity.
48
+ // And The Activity would take over the ownership of `ReactInstanceManager`.
49
+ // This case happens when a user clicks a background task triggered notification immediately.
50
+ if (appRecord.lifecycleState == LifecycleState.BEFORE_CREATE) {
51
+ appRecord.destroy()
52
+ }
47
53
  HeadlessAppLoaderNotifier.notifyAppDestroyed(appScopeKey)
48
54
  appRecords.remove(appScopeKey)
49
55
  }
@@ -1,6 +1,7 @@
1
1
  package expo.modules.core.interfaces;
2
2
 
3
3
  import android.app.Activity;
4
+ import android.content.Intent;
4
5
  import android.os.Bundle;
5
6
 
6
7
  public interface ReactActivityLifecycleListener {
@@ -11,4 +12,26 @@ public interface ReactActivityLifecycleListener {
11
12
  default void onPause(Activity activity) {}
12
13
 
13
14
  default void onDestroy(Activity activity) {}
15
+
16
+ /**
17
+ * Called when {@link com.facebook.react.ReactActivity} received `onNewIntent`
18
+ * Every listener will receive this callback.
19
+ * `ReactActivityDelegateWrapper.onNewIntent` will get `true` if there's some module returns `true`
20
+ *
21
+ * @return true if this module wants to return `true` from `ReactActivityDelegateWrapper.onNewIntent`
22
+ */
23
+ default boolean onNewIntent(Intent intent) {
24
+ return false;
25
+ }
26
+
27
+ /**
28
+ * Called when {@link com.facebook.react.ReactActivity} received `onBackPressed`
29
+ * Every listener will receive this callback.
30
+ * `ReactActivityDelegateWrapper.onBackPressed` will get `true` if there's some module returns `true`
31
+ *
32
+ * @return true if this module wants to return `true` from `ReactActivityDelegateWrapper.onBackPressed`
33
+ */
34
+ default boolean onBackPressed() {
35
+ return false;
36
+ }
14
37
  }
@@ -21,8 +21,19 @@ open class ExpoAppDelegate: UIResponder, UIApplicationDelegate {
21
21
  // MARK: - Initializing the App
22
22
 
23
23
  open func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
24
- return subscribers.reduce(false) { result, subscriber in
25
- return subscriber.application?(application, willFinishLaunchingWithOptions: launchOptions) ?? false || result
24
+ let parsedSubscribers = subscribers.filter {
25
+ $0.responds(to: #selector(application(_:willFinishLaunchingWithOptions:)))
26
+ }
27
+
28
+ // If we can't find a subscriber that implements `willFinishLaunchingWithOptions`, we will delegate the decision if we can handel the passed URL to
29
+ // the `didFinishLaunchingWithOptions` method by returning `true` here.
30
+ // You can read more about how iOS handles deep links here: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application#discussion
31
+ if (parsedSubscribers.isEmpty) {
32
+ return true;
33
+ }
34
+
35
+ return parsedSubscribers.reduce(false) { result, subscriber in
36
+ return subscriber.application!(application, willFinishLaunchingWithOptions: launchOptions) || result
26
37
  }
27
38
  }
28
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "0.6.1",
3
+ "version": "0.6.5",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "@testing-library/react-hooks": "^7.0.1",
43
43
  "expo-module-scripts": "^2.0.0"
44
44
  },
45
- "gitHead": "cf8e7fde1b19e10dd9b74a8af0e9362ae8e14001"
45
+ "gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
46
46
  }