|
@@ -60,7 +60,7 @@
|
|
|
[self initUM];
|
|
|
[self registeredPush]; //注册原生推送
|
|
|
[self registeredATAuth];//
|
|
|
-
|
|
|
+
|
|
|
if (launchOptions) {
|
|
|
[GlobalData shareInstance].isWakeUpStatus = YES;//唤醒启动
|
|
|
// 不是空 就是推送点击
|
|
@@ -282,7 +282,11 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:OpenPushLinkUrlMethods object:nil userInfo:user_info];
|
|
|
}
|
|
|
}else {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushUrlOtherMethods object:nil userInfo:user_info];
|
|
|
+ if (![GlobalData shareInstance].isSearchToLoad) {
|
|
|
+ [self waitingToBeClickNoti:user_info isOpenLinke:NO];
|
|
|
+ }else {
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushUrlOtherMethods object:nil userInfo:user_info];
|
|
|
+ }
|
|
|
}
|
|
|
if([userInfo[@"type"] isEqualToString:@"message"]||[userInfo[@"type"] isEqualToString:@"titleMessage"]) {
|
|
|
NSDictionary * infoDic;
|
|
@@ -325,12 +329,14 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
|
|
|
BOOL isLinks = [infoDict[@"links"] integerValue]==0?NO:YES;
|
|
|
NSDictionary *userInfo = infoDict[@"userInfo"];
|
|
|
if ([LXUserDefaults isExistToken]) {//登录正常状态
|
|
|
- if (isLinks) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushLinkUrlMethods object:nil userInfo:userInfo];
|
|
|
- }else {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushUrlOtherMethods object:nil userInfo:userInfo];
|
|
|
+ if ([GlobalData shareInstance].isSearchToLoad) {
|
|
|
+ if (isLinks) {
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushLinkUrlMethods object:nil userInfo:userInfo];
|
|
|
+ }else {
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:OpenPushUrlOtherMethods object:nil userInfo:userInfo];
|
|
|
+ }
|
|
|
+ [self clearTimer];
|
|
|
}
|
|
|
- [self clearTimer];
|
|
|
}else { //未登录异常状态
|
|
|
NSLog(@"未登录状态-等待:%@",infoDict[@"index"]);
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:LoginIndexTabBar object:nil userInfo:@{@"item_index":infoDict[@"index"]}];
|
|
@@ -340,51 +346,23 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
|
|
|
[self clearTimer];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-(void)clearTimer {
|
|
|
self.timerIndex = 0;
|
|
|
[self.timerClick invalidate];
|
|
|
self.timerClick = nil;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-(void)receiveNotification:(NSDictionary *)userInfo {
|
|
|
-
|
|
|
NSDictionary *infoDict = userInfo[@"info"];
|
|
|
if ([infoDict isKindOfClass:[NSString class]]) {
|
|
|
infoDict = [[LXViewControllerManager shareViewControllerManager] dictionaryWithJsonString:userInfo[@"info"]];
|
|
|
}
|
|
|
if ([infoDict objectForKey:@"url"]) {//数据正常
|
|
|
- NSString * reddot = [NSString stringWithFormat:@"%@",infoDict[@"reddot"]];
|
|
|
- NSString *index = @"";
|
|
|
- if ([reddot isEqualToString:@"search"]) {
|
|
|
- [GlobalData shareInstance].searchIsRed = YES;
|
|
|
- index = @"0";
|
|
|
- }else if ([reddot isEqualToString:@"subscribe"]) {
|
|
|
- [GlobalData shareInstance].subIsRed = YES;
|
|
|
- index = @"1";
|
|
|
- }else if ([reddot isEqualToString:@"box"]) {
|
|
|
- [GlobalData shareInstance].boxIsRed = YES;
|
|
|
- index = @"3";
|
|
|
- }else if ([reddot isEqualToString:@"me"]) {
|
|
|
- [GlobalData shareInstance].mineIsRed = YES;
|
|
|
- index = @"4";
|
|
|
- }else if ([reddot isEqualToString:@"message"]) {
|
|
|
- [GlobalData shareInstance].messIsRed = YES;
|
|
|
- index = @"2";
|
|
|
-
|
|
|
- }else {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:JYReceiveNewsRedPoint object:nil userInfo:@{@"index":index,@"typeMsg":userInfo[@"type"],@"url":infoDict[@"url"]}];
|
|
|
-
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:JYReceiveNewsRedPoint object:nil userInfo:@{@"typeMsg":userInfo[@"type"],@"url":infoDict[@"url"]}];
|
|
|
if([userInfo[@"type"] isEqualToString:@"message"]||[userInfo[@"type"] isEqualToString:@"titleMessage"]) {
|
|
|
-
|
|
|
- NSDictionary * infoDic = @{@"url":infoDict[@"url"],
|
|
|
- @"rectype":@"D",
|
|
|
- @"openid":infoDict[@"openid"],
|
|
|
+ NSDictionary * infoDic =@{
|
|
|
+ @"url":infoDict[@"url"],
|
|
|
+ @"rectype":@"D",
|
|
|
+ @"openid":infoDict[@"openid"],
|
|
|
};
|
|
|
[[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
|
|
|
} success:^(id responseObject) {
|
|
@@ -392,14 +370,11 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
|
|
|
} failure:^(NSError *error) {
|
|
|
NSLog(@"error=%@",error);
|
|
|
}];
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
// NOTE: 9.0以后使用新API接口
|
|
|
-- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
|
|
|
-{
|
|
|
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
|
|
|
BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url];
|
|
|
if (!result) {
|
|
|
// 其他如支付等SDK的回调
|