瀏覽代碼

revert screen change event condition and global scree event condition before 1.1.464 (#3548)

NaoyaKurahashi 6 年之前
父節點
當前提交
734e241c69
共有 1 個文件被更改,包括 5 次插入6 次删除
  1. 5
    6
      ios/RCCViewController.m

+ 5
- 6
ios/RCCViewController.m 查看文件

@@ -205,8 +205,8 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
205 205
 }
206 206
 
207 207
 - (void)sendScreenChangedEvent:(NSString *)eventName {
208
-    if (self.view != nil) {
209
-        RCTRootView *rootView = self.view;
208
+    if ([self.view isKindOfClass:[RCTRootView class]]) {
209
+        RCTRootView *rootView = (RCTRootView *)self.view;
210 210
         
211 211
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
212 212
             
@@ -220,10 +220,9 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
220 220
 }
221 221
 
222 222
 - (void)sendGlobalScreenEvent:(NSString *)eventName endTimestampString:(NSString *)endTimestampStr shouldReset:(BOOL)shouldReset {
223
-    if (self.view != nil){
224
-        RCTRootView *rootView = self.view;
225
-        NSString *screenName = [rootView moduleName];
226
-        
223
+    if ([self.view isKindOfClass:[RCTRootView class]]){
224
+        NSString *screenName = [((RCTRootView *)self.view) moduleName];
225
+
227 226
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
228 227
          {
229 228
              @"commandType": self.commandType ? self.commandType : @"",