You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/28 15:27:05 UTC

[GitHub] julonglu opened a new issue #2092: [Android][iOS][Dev-tool] Unexpected behavior when xx where weex version is 0.aa.bb.cc

julonglu opened a new issue #2092: [Android][iOS][Dev-tool] Unexpected behavior when xx where weex version is 0.aa.bb.cc
URL: https://github.com/apache/incubator-weex/issues/2092
 
 
   
   - (void)_checkPageName
   {
       if (nil == self.pageName || [self.pageName isEqualToString:@""]) {
           NSURLComponents *components = [[NSURLComponents alloc] initWithString:self.scriptURL.absoluteString];
           [components.queryItems enumerateObjectsUsingBlock:^(NSURLQueryItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
               if([obj.name isEqualToString:@"pageName"]){
                   self.pageName  = obj.value;
               }
               NSLog(@"%@=%@",obj.name,obj.value);
           }];
   //        self.pageName = [self.scriptURL isFileURL] ? self.scriptURL.path.lastPathComponent: self.scriptURL.absoluteString;
       }
       if (nil == self.pageName || [self.pageName isEqualToString:@""]) {
   //        self.pageName = NSStringFromClass(self.viewController.class)?:@"unkonwPageCauseUnsetNameAndUrlAndVc";
           self.pageName = @"indexpage";
       }
   }
   以上改为将路径中所携带的参数pageName作为页面名称,避免出现一长串的URL路径作为页面名称
   
   
   [self fireGlobalEvent:WX_APPLICATION_DID_BECOME_ACTIVE params:nil];
   [self fireGlobalEvent:WX_APPLICATION_WILL_RESIGN_ACTIVE params:nil];
   
   以上两处为何不改为以下这样处理,以下这种方式可以知道前后台切换时,当前用户正在浏览哪一个页面,可以作出细致的处理
   
   NSDictionary *params = @{@"pageName": self.pageName};
   [self fireGlobalEvent:WX_APPLICATION_DID_BECOME_ACTIVE params:params];
   [self fireGlobalEvent:WX_APPLICATION_WILL_RESIGN_ACTIVE params:params];
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services