|
@@ -5,6 +5,8 @@ import android.os.Handler;
|
5
|
5
|
import android.support.annotation.NonNull;
|
6
|
6
|
|
7
|
7
|
import com.facebook.react.ReactPackage;
|
|
8
|
+import com.facebook.react.bridge.ReactContext;
|
|
9
|
+import com.facebook.react.bridge.WritableMap;
|
8
|
10
|
import com.facebook.react.shell.MainReactPackage;
|
9
|
11
|
import com.reactnativenavigation.bridge.NavigationReactPackage;
|
10
|
12
|
import com.reactnativenavigation.react.NavigationReactInstance;
|
|
@@ -66,15 +68,27 @@ public abstract class NavigationApplication extends Application {
|
66
|
68
|
return "index.android.bundle";
|
67
|
69
|
}
|
68
|
70
|
|
|
71
|
+ public ReactContext getReactContext() {
|
|
72
|
+ return navigationReactInstance.getReactInstanceManager().getCurrentReactContext();
|
|
73
|
+ }
|
|
74
|
+
|
69
|
75
|
public abstract boolean isDebug();
|
70
|
76
|
|
71
|
77
|
@NonNull
|
72
|
78
|
public abstract List<ReactPackage> createAdditionalReactPackages();
|
73
|
79
|
|
|
80
|
+ public void sendNavigatorEvent(String eventId, String navigatorEventId) {
|
|
81
|
+ navigationReactInstance.getReactEventEmitter().sendNavigatorEvent(eventId, navigatorEventId);
|
|
82
|
+ }
|
|
83
|
+
|
74
|
84
|
public void sendEvent(String eventId, String navigatorEventId) {
|
75
|
85
|
navigationReactInstance.getReactEventEmitter().sendEvent(eventId, navigatorEventId);
|
76
|
86
|
}
|
77
|
87
|
|
|
88
|
+ public void sendNavigatorEvent(String eventId, WritableMap arguments) {
|
|
89
|
+ navigationReactInstance.getReactEventEmitter().sendEvent(eventId, arguments);
|
|
90
|
+ }
|
|
91
|
+
|
78
|
92
|
public void startReactContext() {
|
79
|
93
|
navigationReactInstance = new NavigationReactInstance();
|
80
|
94
|
navigationReactInstance.startReactContextOnceInBackgroundAndExecuteJS();
|