Commit ed36a04c1f05ad29f883a0ef3dfc5acd85f7763f

Authored by daojian
1 parent 27b1c582

0.4.0 添加家园有新消息通知

CNLiveNewIMAManagerKit.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveNewIMAManagerKit' 10 s.name = 'CNLiveNewIMAManagerKit'
11 - s.version = '0.3.9' 11 + s.version = '0.4.0'
12 s.summary = 'A short description of CNLiveNewIMAManagerKit.' 12 s.summary = 'A short description of CNLiveNewIMAManagerKit.'
13 13
14 #s.description = <<-DESC 14 #s.description = <<-DESC
CNLiveNewIMAManagerKit/Classes/Playform/IMAConversationManager.m
@@ -708,7 +708,7 @@ @@ -708,7 +708,7 @@
708 NSLog(@"onNewMessage:%@",msgs); 708 NSLog(@"onNewMessage:%@",msgs);
709 709
710 [[NSNotificationCenter defaultCenter] postNotificationName:@"kIMAMSG_OnNewMessageNotification" object:msgs]; 710 [[NSNotificationCenter defaultCenter] postNotificationName:@"kIMAMSG_OnNewMessageNotification" object:msgs];
711 - 711 +
712 for (TIMMessage *msg in msgs) 712 for (TIMMessage *msg in msgs)
713 { 713 {
714 IMAMsg *imamsg = [IMAMsg msgWith:msg]; 714 IMAMsg *imamsg = [IMAMsg msgWith:msg];
@@ -718,7 +718,15 @@ @@ -718,7 +718,15 @@
718 } 718 }
719 TIMConversation *conv = [msg getConversation]; 719 TIMConversation *conv = [msg getConversation];
720 NSLog(@"getReceiver =========== %@",conv.getReceiver); 720 NSLog(@"getReceiver =========== %@",conv.getReceiver);
721 - 721 + if ([conv.getReceiver hasPrefix:@"family_"]) {
  722 + //家园新消息
  723 + NSInteger unReadMessageNum = [conv getUnReadMessageNum];
  724 + [[NSNotificationCenter defaultCenter] postNotificationName:kIMAMSG_FamilyNewMessageNotification object:nil userInfo:@{
  725 + @"groupId" : conv.getReceiver,
  726 + @"unReadMessageNum" : @(unReadMessageNum)}
  727 + ];
  728 +
  729 + }
722 if ([[imamsg.msg getElem:0] isKindOfClass:[TIMCustomElem class]]) { 730 if ([[imamsg.msg getElem:0] isKindOfClass:[TIMCustomElem class]]) {
723 /**处理所有收到的自定义消息*/ 731 /**处理所有收到的自定义消息*/
724 BOOL isBreak = [self handleCustomMsg:imamsg conv:conv]; 732 BOOL isBreak = [self handleCustomMsg:imamsg conv:conv];
CNLiveNewIMAManagerKit/Classes/PublicHeader/IMANotification.h
@@ -172,4 +172,6 @@ static NSString *const kIMAMSG_CommunityPaySuccessNotification = @&quot;kIMAMSG_Commu @@ -172,4 +172,6 @@ static NSString *const kIMAMSG_CommunityPaySuccessNotification = @&quot;kIMAMSG_Commu
172 #pragma mark 扫码支付成功 172 #pragma mark 扫码支付成功
173 static NSString *const kIMAMSG_ScanPaySuccessNotification = @"kIMAMSG_ScanPaySuccessNotification"; 173 static NSString *const kIMAMSG_ScanPaySuccessNotification = @"kIMAMSG_ScanPaySuccessNotification";
174 174
  175 +#pragma mark 收到家园群消息
  176 +static NSString *const kIMAMSG_FamilyNewMessageNotification = @"kIMAMSG_FamilyNewMessageNotification";
175 #endif /* IMANotification_h */ 177 #endif /* IMANotification_h */