Przeglądaj źródła

Fix Global Events and Screen Events do not work after iPhoneX patch (#1668)

* fix navigatorStyle don't work on Drawer

* Fix lightbox dismiss on Android

* Update LightBox.java

* Add splash screen tut in third party lib support list

* Revert the old drawer commit

* Fix screen events
Phạm Quan Khiết Luân 6 lat temu
rodzic
commit
241349625f
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5
    5
      ios/RCCViewController.m

+ 5
- 5
ios/RCCViewController.m Wyświetl plik

208
 }
208
 }
209
 
209
 
210
 - (void)sendScreenChangedEvent:(NSString *)eventName {
210
 - (void)sendScreenChangedEvent:(NSString *)eventName {
211
-    if ([self.view isKindOfClass:[RCTRootView class]]) {
212
-        
213
-        RCTRootView *rootView = (RCTRootView *)self.view;
211
+    if (self.rootView != nil) {
212
+        RCTRootView *rootView = self.rootView;
214
         
213
         
215
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
214
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
216
             
215
             
224
 }
223
 }
225
 
224
 
226
 - (void)sendGlobalScreenEvent:(NSString *)eventName endTimestampString:(NSString *)endTimestampStr shouldReset:(BOOL)shouldReset {
225
 - (void)sendGlobalScreenEvent:(NSString *)eventName endTimestampString:(NSString *)endTimestampStr shouldReset:(BOOL)shouldReset {
227
-    if ([self.view isKindOfClass:[RCTRootView class]]){
228
-        NSString *screenName = [((RCTRootView*)self.view) moduleName];
226
+    if (self.rootView != nil){
227
+        RCTRootView *rootView = self.rootView;
228
+        NSString *screenName = [rootView moduleName];
229
         
229
         
230
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
230
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
231
          {
231
          {