|
@@ -232,35 +232,35 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
|
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
if (info[@"url"]) {
|
|
if (info[@"url"]) {
|
|
|
|
|
|
- if (userInfo[@"type"] && ![userInfo[@"type"] isEqualToString:@""]) {
|
|
|
|
- [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- NSString *pushTime = info[@"pushTime"];
|
|
|
|
- if (pushTime && ![pushTime isEqualToString:@""]) {
|
|
|
|
-
|
|
|
|
- if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
- }
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] changeReadedWithPushTime:info[@"pushTime"]];
|
|
|
|
- if (!info[@"type"] || [info[@"type"] isEqualToString:@""]) {
|
|
|
|
- NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnID:info[@"pushTime"] inTable:kNewsTable];
|
|
|
|
- if (ids) {
|
|
|
|
- [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
-
|
|
|
|
- if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
- }
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] changeReadedWithURL:info[@"url"] openid:info[@"openid"]];
|
|
|
|
- NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnIDWithUrl:info[@"url"] openid:info[@"openid"] inTable:kNewsTable];
|
|
|
|
- if (ids) {
|
|
|
|
- [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// if (userInfo[@"type"] && ![userInfo[@"type"] isEqualToString:@""]) {
|
|
|
|
+// [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// NSString *pushTime = info[@"pushTime"];
|
|
|
|
+// if (pushTime && ![pushTime isEqualToString:@""]) {
|
|
|
|
+//
|
|
|
|
+// if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
|
|
|
|
+//// [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
+// }
|
|
|
|
+// [[LXDataBaseManager shareDataBaseManager] changeReadedWithPushTime:info[@"pushTime"]];
|
|
|
|
+// if (!info[@"type"] || [info[@"type"] isEqualToString:@""]) {
|
|
|
|
+// NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnID:info[@"pushTime"] inTable:kNewsTable];
|
|
|
|
+// if (ids) {
|
|
|
|
+// [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }else{
|
|
|
|
+//
|
|
|
|
+// if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
|
|
|
|
+//// [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
+// }
|
|
|
|
+// [[LXDataBaseManager shareDataBaseManager] changeReadedWithURL:info[@"url"] openid:info[@"openid"]];
|
|
|
|
+// NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnIDWithUrl:info[@"url"] openid:info[@"openid"] inTable:kNewsTable];
|
|
|
|
+// if (ids) {
|
|
|
|
+// [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
// 跳转到该链接
|
|
// 跳转到该链接
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
|
|
@@ -271,10 +271,10 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
|
self.wakeUpBool = NO;
|
|
self.wakeUpBool = NO;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- if([info[@"type"] isEqualToString:@"message"]) {
|
|
|
|
|
|
+ NSLog(@"%@",info);
|
|
|
|
+ if([userInfo[@"type"] isEqualToString:@"message"]) {
|
|
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:info[@"url"]];
|
|
|
|
|
|
+ [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:userInfo[@"url"]];
|
|
|
|
|
|
NSDictionary * infoDic;
|
|
NSDictionary * infoDic;
|
|
if(self.wakeUpBool) {
|
|
if(self.wakeUpBool) {
|
|
@@ -338,42 +338,42 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
|
NSLog(@"info--新消息%@",info);
|
|
NSLog(@"info--新消息%@",info);
|
|
if (info ) {
|
|
if (info ) {
|
|
if (info[@"url"]) {
|
|
if (info[@"url"]) {
|
|
- NSString *pushTime = info[@"pushTime"];
|
|
|
|
- if (pushTime && ![pushTime isEqualToString:@""]) {
|
|
|
|
-
|
|
|
|
- if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
|
|
|
|
- NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
- if (userInfo[@"type"]) {
|
|
|
|
- [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
- }
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
-
|
|
|
|
- if([info[@"type"] isEqualToString:@"message"]) {
|
|
|
|
- NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
- if (userInfo[@"type"]) {
|
|
|
|
- [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
- }
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
- }else {
|
|
|
|
- if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
|
|
|
|
- NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
- if (userInfo[@"type"]) {
|
|
|
|
- [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
- }
|
|
|
|
- [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+// NSString *pushTime = info[@"pushTime"];
|
|
|
|
+// if (pushTime && ![pushTime isEqualToString:@""]) {
|
|
|
|
+//
|
|
|
|
+// if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
|
|
|
|
+// NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
+// if (userInfo[@"type"]) {
|
|
|
|
+// [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
+// }
|
|
|
|
+//// [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// else{
|
|
|
|
+//
|
|
|
|
+// if([info[@"type"] isEqualToString:@"message"]) {
|
|
|
|
+// NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
+// if (userInfo[@"type"]) {
|
|
|
|
+// [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
+// }
|
|
|
|
+//// [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
+// }else {
|
|
|
|
+// if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
|
|
|
|
+// NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
|
|
|
|
+// if (userInfo[@"type"]) {
|
|
|
|
+// [temp setObject:userInfo[@"type"] forKey:@"type"];
|
|
|
|
+// }
|
|
|
|
+//// [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:kAfterReceiveNewMsg object:nil];
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:kAfterReceiveNewMsg object:nil];
|
|
|
|
|
|
|
|
|
|
//
|
|
//
|
|
- if([info[@"type"] isEqualToString:@"message"]) {
|
|
|
|
|
|
+ if([userInfo[@"type"] isEqualToString:@"message"]) {
|
|
|
|
|
|
NSDictionary * infoDic = @{@"url":info[@"url"],
|
|
NSDictionary * infoDic = @{@"url":info[@"url"],
|
|
@"rectype":@"D",
|
|
@"rectype":@"D",
|
|
@@ -392,13 +392,19 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if([info[@"type"] isEqualToString:@"bid"]) {
|
|
|
|
|
|
+ if([userInfo[@"type"] isEqualToString:@"bid"]) {
|
|
//收到订阅推送,展示红点
|
|
//收到订阅推送,展示红点
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"1",@"typeMsg":info[@"type"]}];
|
|
|
|
|
|
+ NSLog(@"收到订阅推送");
|
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"1",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
|
|
|
|
+ }else {
|
|
|
|
+ NSLog(@"不是订阅推送");
|
|
}
|
|
}
|
|
- if([info[@"type"] isEqualToString:@"message"]||[info[@"type"] isEqualToString:@"feedback"]||[info[@"type"] isEqualToString:@"project"]||[info[@"type"] isEqualToString:@"entname"]) {
|
|
|
|
|
|
+ if([userInfo[@"type"] isEqualToString:@"message"]||[userInfo[@"type"] isEqualToString:@"feedback"]||[userInfo[@"type"] isEqualToString:@"project"]||[userInfo[@"type"] isEqualToString:@"entname"]) {
|
|
|
|
+ NSLog(@"收到我的推送");
|
|
//收到我的推送,展示红点
|
|
//收到我的推送,展示红点
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":info[@"type"]}];
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
|
|
|
|
+ }else {
|
|
|
|
+ NSLog(@"不是订阅推送");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|