瀏覽代碼

我的消息红点

apple 6 年之前
父節點
當前提交
79262d5c6b

二進制
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 16
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -13,21 +13,5 @@
             stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYSearchViewController.m"
-            timestampString = "568790720.323967"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "176"
-            endingLineNumber = "176"
-            landmarkName = "-newsRedPoint:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 11 - 3
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -263,11 +263,19 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 //            }
             
             // 跳转到该链接
-            [[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
+            
+
+            
+            if([userInfo[@"type"] isEqualToString:@"bid"]) {
+                //如果是订阅消息
+                [[NSNotificationCenter defaultCenter] postNotificationName:ClickSubNotiMethods object:userInfo userInfo:nil];
+            }else {
+                [[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
+            }
             
             if(self.wakeUpBool) {
                 //刚启动
-                [[NSUserDefaults standardUserDefaults]setObject:temp forKey:@"NotiDict"];
+                [[NSUserDefaults standardUserDefaults]setObject:userInfo forKey:@"NotiDict"];
                 self.wakeUpBool = NO;
             }
             
@@ -404,7 +412,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
                 //收到我的推送,展示红点
                 [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
             }else {
-                NSLog(@"不是订阅推送");
+                NSLog(@"不是我的推送");
             }
             
         }

+ 3 - 2
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -86,15 +86,16 @@ _Pragma("clang diagnostic pop")\
 
 
 
-
 #define kRequestWebViewWithUrl @"kRequestWebViewWithUrl"
+
 #define kUpdateNotifyState @"kUpdateNotifyState"
 #define kAfterReceiveNewMsg @"kAfterReceiveNewMsg"
 #define JYNewsRedPoint @"JYNewsRedPoint"
 #define kReloadWebVIew @"kReloadWebVIew"
 #define kLoginOut @"kLoginOut"
 #define kNewsTable @"kNewsTable"
-
+//点击订阅通知
+#define ClickSubNotiMethods @"ClickSubNotiMethods"
 
 
 

+ 20 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m

@@ -95,6 +95,9 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self webViewFirstRequest];//请求页面数据
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
@@ -284,6 +287,23 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
     
 }
 
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 2) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
 
 
 

+ 31 - 10
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -105,6 +105,9 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self webViewFirstRequest];//请求页面数据
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
@@ -305,6 +308,23 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     
 }
 
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 3) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
 
 
 
@@ -701,16 +721,16 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     NSLog(@"openid=%@",openid);
     //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
     
-    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
-        //显示
-        kMainQueue(^{
-            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
-        });
-    }else {
-        kMainQueue(^{
-            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
-        });
-    }
+//    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
+//        //显示
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+//        });
+//    }else {
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+//        });
+//    }
     
     return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
 }
@@ -969,6 +989,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 
 -(void)jsHideRedSpotOnMenu:(NSString*)str
 {
+    NSLog(@"wd:%@",str);
     kMainQueue(^{
         [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
     });

+ 42 - 21
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -114,6 +114,9 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self webViewFirstRequest];//请求页面数据
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
@@ -173,7 +176,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
         
     }
     
-    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],@""];
+    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
     JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
     [context evaluateScript:textJS];
 }
@@ -221,19 +224,25 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     _timeTick++;
     NSLog(@"定时器");
     if(self.webView&&notiFinish) {
-        NSString * urlStr = [NSString stringWithFormat:@"%@",self.notiDict[@"url"]];
+        NSString * urlStr = [NSString stringWithFormat:@"%@",self.notiDict[@"info"][@"url"]];
         
         if (urlStr) {
-            [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
-            self.afterOpenPushMessage = YES;
-            [self performSelector:@selector(requestWebTime:) withObject:self.notiDict afterDelay:1];
+            if([self.notiDict[@"type"] isEqualToString:@"bid"]) {
+                AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+                JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+                tab.selectedIndex = 1;
+            }else {
+                [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+                self.afterOpenPushMessage = YES;
+                [self performSelector:@selector(requestWebTime:) withObject:self.notiDict afterDelay:1];
+            }
+            
             
             [self.timer invalidate];
             self.timer = nil;
             _timeTick = 0;
             [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
             
-            
         }
         return;
     }
@@ -405,7 +414,6 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
     
     if (urlStr) {
-        
         //当前控制器
         if(self.tabBarController.selectedIndex != 0) {
             return;
@@ -413,18 +421,31 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
             [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
         }
         
-        
-        
         [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
         self.afterOpenPushMessage = YES;
-        
-        
         [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
     }
     
     
 }
 
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 0) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
 
 
 
@@ -969,16 +990,16 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
 -(int)jsGetUnReadMessageCount:(NSString *)openid{
     NSLog(@"openid=%@",openid);
     //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
-    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
-        //显示
-        kMainQueue(^{
-            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
-        });
-    }else {
-        kMainQueue(^{
-            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
-        });
-    }
+//    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
+//        //显示
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+//        });
+//    }else {
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+//        });
+//    }
     return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
 }
 

+ 21 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m

@@ -89,6 +89,10 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self webViewFirstRequest];//请求页面数据
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
@@ -277,6 +281,22 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 
 
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 1) {
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+
+
+
 
 
 // 收到通知消息
@@ -881,6 +901,7 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
 
 -(void)jsHideRedSpotOnMenu:(NSString*)str
 {
+    NSLog(@"dy:%@",str);
     kMainQueue(^{
         [self.tabBarController.tabBar hideBadgeOnItemIndex:1];
     });