Просмотр исходного кода

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 лет назад
Родитель
Сommit
241349625f
1 измененных файлов: 5 добавлений и 5 удалений
  1. 5
    5
      ios/RCCViewController.m

+ 5
- 5
ios/RCCViewController.m Просмотреть файл

@@ -208,9 +208,8 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
208 208
 }
209 209
 
210 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 214
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
216 215
             
@@ -224,8 +223,9 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
224 223
 }
225 224
 
226 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 230
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
231 231
          {