Browse Source

Delegate onNewIntent to reactInstanceManager

Guy Carmeli 6 years ago
parent
commit
3074407577

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

39
         getReactGateway().onActivityResumed(this);
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
     @Override
49
     @Override
43
     protected void onPause() {
50
     protected void onPause() {
44
         super.onPause();
51
         super.onPause();

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

46
 		jsDevReloadHandler.onActivityResumed(activity);
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
 	public void onActivityPaused(NavigationActivity activity) {
57
 	public void onActivityPaused(NavigationActivity activity) {
50
 		initializer.onActivityPaused(activity);
58
 		initializer.onActivityPaused(activity);
51
 		jsDevReloadHandler.onActivityPaused(activity);
59
 		jsDevReloadHandler.onActivityPaused(activity);