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
     public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
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
         }
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
     @Override
128
     @Override
122
     protected void onPause() {
129
     protected void onPause() {
123
         super.onPause();
130
         super.onPause();

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

69
         getReactInstanceManager().onHostPause();
69
         getReactInstanceManager().onHostPause();
70
     }
70
     }
71
 
71
 
72
+    public void onNewIntent(Intent intent) {
73
+        getReactInstanceManager().onNewIntent(intent);
74
+    }
75
+
72
     public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
76
     public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
73
         getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
77
         getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
74
     }
78
     }

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

31
     void onActivityResult(int requestCode, int resultCode, Intent data);
31
     void onActivityResult(int requestCode, int resultCode, Intent data);
32
 
32
 
33
     boolean hasStartedCreatingContext();
33
     boolean hasStartedCreatingContext();
34
+
35
+    void onNewIntent(Intent intent);
34
 }
36
 }