expo-modules-core 0.6.3 → 0.6.4

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,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.6.4 — 2022-01-05
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix `ReactInstanceManager.onHostPause` exception from moving Android apps to background. ([#15748](https://github.com/expo/expo/pull/15748) by [@kudo](https://github.com/kudo))
18
+
13
19
  ## 0.6.3 — 2021-12-16
14
20
 
15
21
  ### 🐛 Bug fixes
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.6.3'
6
+ version = '0.6.4'
7
7
 
8
8
  buildscript {
9
9
  // Simple helper that allows the root project to override versions declared by this library.
@@ -58,7 +58,7 @@ android {
58
58
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
59
59
  consumerProguardFiles 'proguard-rules.pro'
60
60
  versionCode 1
61
- versionName "0.6.3"
61
+ versionName "0.6.4"
62
62
  }
63
63
  lintOptions {
64
64
  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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
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": "150733e32b766c53c573ed505d2fe42bd8ceaa75"
45
+ "gitHead": "81d318c3ac2db24ba192d2b3fc5a2dd1bbd8bd4d"
46
46
  }