Browse Source

Expose onNewIntent in ActivityCallbacks (#759)

Guy Carmeli 7 years ago
parent
commit
d8c2e9076a

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/ActivityCallbacks.java View File

@@ -36,4 +36,8 @@ public class ActivityCallbacks {
36 36
     public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
37 37
 
38 38
     }
39
+
40
+    public void onNewIntent(Intent intent) {
41
+
42
+    }
39 43
 }

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

@@ -118,6 +118,13 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
118 118
         }
119 119
     }
120 120
 
121
+    @Override
122
+    protected void onNewIntent(Intent intent) {
123
+        super.onNewIntent(intent);
124
+        NavigationApplication.instance.getReactGateway().onNewIntent(intent);
125
+        NavigationApplication.instance.getActivityCallbacks().onNewIntent(intent);
126
+    }
127
+
121 128
     @Override
122 129
     protected void onPause() {
123 130
         super.onPause();

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java View File

@@ -69,6 +69,10 @@ public class NavigationReactGateway implements ReactGateway {
69 69
         getReactInstanceManager().onHostPause();
70 70
     }
71 71
 
72
+    public void onNewIntent(Intent intent) {
73
+        getReactInstanceManager().onNewIntent(intent);
74
+    }
75
+
72 76
     public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
73 77
         getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
74 78
     }

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

@@ -31,4 +31,6 @@ public interface ReactGateway {
31 31
     void onActivityResult(int requestCode, int resultCode, Intent data);
32 32
 
33 33
     boolean hasStartedCreatingContext();
34
+
35
+    void onNewIntent(Intent intent);
34 36
 }