Sfoglia il codice sorgente

Delegate onNewIntent to reactInstanceManager

Guy Carmeli 6 anni fa
parent
commit
3074407577

+ 7
- 0
lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java Vedi File

@@ -39,6 +39,13 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
39 39
         getReactGateway().onActivityResumed(this);
40 40
     }
41 41
 
42
+    @Override
43
+    public void onNewIntent(Intent intent) {
44
+        if (!getReactGateway().onNewIntent(intent)) {
45
+            super.onNewIntent(intent);
46
+        }
47
+    }
48
+
42 49
     @Override
43 50
     protected void onPause() {
44 51
         super.onPause();

+ 8
- 0
lib/android/app/src/main/java/com/reactnativenavigation/react/ReactGateway.java Vedi File

@@ -46,6 +46,14 @@ public class ReactGateway {
46 46
 		jsDevReloadHandler.onActivityResumed(activity);
47 47
 	}
48 48
 
49
+    public boolean onNewIntent(Intent intent) {
50
+        if (getReactNativeHost().hasInstance()) {
51
+            getReactNativeHost().getReactInstanceManager().onNewIntent(intent);
52
+            return true;
53
+        }
54
+        return false;
55
+    }
56
+
49 57
 	public void onActivityPaused(NavigationActivity activity) {
50 58
 		initializer.onActivityPaused(activity);
51 59
 		jsDevReloadHandler.onActivityPaused(activity);