Browse Source

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

NaoyaKurahashi 6 years ago
parent
commit
734e241c69
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      ios/RCCViewController.m

+ 5
- 6
ios/RCCViewController.m View File

205
 }
205
 }
206
 
206
 
207
 - (void)sendScreenChangedEvent:(NSString *)eventName {
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
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
211
         if (rootView.appProperties && rootView.appProperties[@"navigatorEventID"]) {
212
             
212
             
220
 }
220
 }
221
 
221
 
222
 - (void)sendGlobalScreenEvent:(NSString *)eventName endTimestampString:(NSString *)endTimestampStr shouldReset:(BOOL)shouldReset {
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
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
226
         [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:eventName body:@
228
          {
227
          {
229
              @"commandType": self.commandType ? self.commandType : @"",
228
              @"commandType": self.commandType ? self.commandType : @"",