Переглянути джерело

3中情况下单推送 处理

apple 7 роки тому
батько
коміт
5e28a49054

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 17 - 7
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -20,6 +20,7 @@
 @interface AppDelegate ()<JPUSHRegisterDelegate>
 @interface AppDelegate ()<JPUSHRegisterDelegate>
 
 
 @property(nonatomic, strong)UIImageView *imgView;
 @property(nonatomic, strong)UIImageView *imgView;
+@property(nonatomic, assign)BOOL wakeUpBool;
 
 
 @end
 @end
 
 
@@ -34,13 +35,15 @@
     
     
     
     
     if (launchOptions) {
     if (launchOptions) {
-        
+        self.wakeUpBool = YES;//唤醒启动
         // 不是空 就是推送点击 否则是图标启动
         // 不是空 就是推送点击 否则是图标启动
         NSDictionary * remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; //这个判断是在程序没有运行的情况下收到通知,点击通知跳转页面
         NSDictionary * remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; //这个判断是在程序没有运行的情况下收到通知,点击通知跳转页面
         if ([[UIDevice currentDevice].systemVersion floatValue] < 10.0 && remoteNotification) {
         if ([[UIDevice currentDevice].systemVersion floatValue] < 10.0 && remoteNotification) {
             // iOS 10 不必走此方法
             // iOS 10 不必走此方法
             [self clickNotification:remoteNotification];
             [self clickNotification:remoteNotification];
         }
         }
+    }else {
+        self.wakeUpBool = NO;
     }
     }
   
   
     return YES;
     return YES;
@@ -247,13 +250,20 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
             
             
             [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:info[@"url"]];
             [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:info[@"url"]];
             
             
+            NSDictionary * infoDic;
+            if(self.wakeUpBool) {
+                infoDic = @{@"url":info[@"url"],
+                            @"rectype":@"A",
+                            @"openid":info[@"openid"],
+                            };
+            }else {
+                infoDic = @{@"url":info[@"url"],
+                  @"rectype":@"C",
+                  @"openid":info[@"openid"],
+                  };
+            }
             
             
-            
-            NSDictionary * infoDic = @{@"url":info[@"url"],
-                                       @"rectype":@"C",
-                                       @"openid":info[@"openid"],
-                                       };
-
+            self.wakeUpBool = NO;
             //post请求
             //post请求
             NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
             NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
             [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
             [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {