@@ -57,41 +57,59 @@ public void sendNavigatorEvent(String eventId, String navigatorEventId) {
5757 if (!NavigationApplication .instance .isReactContextInitialized ()) {
5858 return ;
5959 }
60- reactGateway .getReactEventEmitter ().sendNavigatorEvent (eventId , navigatorEventId );
60+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
61+ if (emitter != null ) {
62+ emitter .sendNavigatorEvent (eventId , navigatorEventId );
63+ }
6164 }
6265
6366 public void sendNavigatorEvent (String eventId , String navigatorEventId , WritableMap data ) {
6467 if (!NavigationApplication .instance .isReactContextInitialized ()) {
6568 return ;
6669 }
67- reactGateway .getReactEventEmitter ().sendNavigatorEvent (eventId , navigatorEventId , data );
70+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
71+ if (emitter != null ) {
72+ emitter .sendNavigatorEvent (eventId , navigatorEventId , data );
73+ }
6874 }
6975
7076 public void sendEvent (String eventId , String navigatorEventId ) {
7177 if (!NavigationApplication .instance .isReactContextInitialized ()) {
7278 return ;
7379 }
74- reactGateway .getReactEventEmitter ().sendEvent (eventId , navigatorEventId );
80+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
81+ if (emitter != null ) {
82+ emitter .sendEvent (eventId , navigatorEventId );
83+ }
7584 }
7685
7786 public void sendNavigatorEvent (String eventId , WritableMap arguments ) {
7887 if (!NavigationApplication .instance .isReactContextInitialized ()) {
7988 return ;
8089 }
81- reactGateway .getReactEventEmitter ().sendEvent (eventId , arguments );
90+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
91+ if (emitter != null ) {
92+ emitter .sendEvent (eventId , arguments );
93+ }
8294 }
8395
8496 public void sendEvent (String eventId ) {
8597 if (!NavigationApplication .instance .isReactContextInitialized ()) {
8698 return ;
8799 }
88- reactGateway .getReactEventEmitter ().sendEvent (eventId , Arguments .createMap ());
100+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
101+ if (emitter != null ) {
102+ emitter .sendEvent (eventId , Arguments .createMap ());
103+ }
89104 }
90105
91106 public void sendAppLaunchedEvent () {
92107 if (!NavigationApplication .instance .isReactContextInitialized ()) {
93108 return ;
94109 }
95- reactGateway .getReactEventEmitter ().sendEvent ("RNN.appLaunched" , Arguments .createMap ());
110+ NavigationReactEventEmitter emitter = reactGateway .getReactEventEmitter ();
111+ if (emitter != null ) {
112+ emitter .sendEvent ("RNN.appLaunched" , Arguments .createMap ());
113+ }
96114 }
97115}
0 commit comments