Commit 0ecaf24397e492a1e2dae3d3a326c7149b665288

Authored by zhangxiaowen
1 parent 9485a65a

no message

Showing 1 changed file with 14 additions and 9 deletions
CNLiveScioLive/AppDelegate.m
... ... @@ -15,6 +15,7 @@
15 15 @interface AppDelegate ()<XGPushDelegate>
16 16 @property (nonatomic, assign) BOOL isPush; //区分普通启动还是推送
17 17 @property (nonatomic, copy) NSString *type; //区分首页还是直播 还是id
  18 +@property (nonatomic, assign) BOOL language; //区分消息是中英文语言
18 19  
19 20 @end
20 21  
... ... @@ -147,14 +148,10 @@
147 148  
148 149 }else if([self.window.rootViewController isKindOfClass:[UITabBarController class]]){
149 150 CNLiveENTabBarController *tabVC = (CNLiveENTabBarController *)self.window.rootViewController;
  151 + tabVC.selectedIndex = 0;
  152 +
150 153 //直播
151   - if([self.type isEqualToString:@"1"]){
152   - tabVC.selectedIndex = 1;
153   -
154   - }else{
155   - //1选中答记者问或者国新视界
156   - tabVC.selectedIndex = 0;
157   -
  154 + if(![self.type isEqualToString:@"1"]){
158 155 //2请求跳转
159 156 [self getDataById:_type];
160 157 }
... ... @@ -293,7 +290,7 @@
293 290 UINavigationController *nav = tabVC.childViewControllers[0];
294 291  
295 292 //判断推送消息是中文还是英文(初始化sdk配置)
296   - [self initializeSDKConfigurationByLanguage:YES];
  293 + [self initializeSDKConfigurationByLanguage:self.language];
297 294  
298 295 //视频
299 296 if([@"program" isEqualToString:dic[@"type"]]){
... ... @@ -376,7 +373,15 @@
376 373 else if ([UIApplication sharedApplication].applicationState == UIApplicationStateInactive)
377 374 {
378 375 NSString *str = response.notification.request.content.categoryIdentifier;
379   - self.type = str;
  376 + NSArray *arr = [str componentsSeparatedByString:@"&"];
  377 +
  378 + self.type = arr.count == 2? arr[0] : str;
  379 + if(arr.count == 2&&[arr[1] isEqualToString:@"en"]){
  380 + self.language = NO;
  381 + }else{
  382 + self.language = YES;
  383 +
  384 + }
380 385 self.isPush = YES;
381 386 }
382 387  
... ...