diff --git a/ios-rongimdemo/RCDAddFriendViewController.m b/ios-rongimdemo/RCDAddFriendViewController.m index e0cbef3c..c936dea4 100644 --- a/ios-rongimdemo/RCDAddFriendViewController.m +++ b/ios-rongimdemo/RCDAddFriendViewController.m @@ -197,42 +197,43 @@ - (void)didReceiveMemoryWarning { // Dispose of any resources that can be recreated. } - (void)actionAddFriend:(id)sender { - RCDUserInfo *user = [[RCDataBaseManager shareInstance] getFriendInfo:_targetUserInfo.userId]; - if (user == nil) { - return; - } - if ([user.status isEqualToString:@"10"]) { - UIAlertView *alertView = [[UIAlertView alloc] - initWithTitle:nil - message:@"已发送好友邀请" - delegate:nil - cancelButtonTitle:@"确定" - otherButtonTitles:nil, nil]; - [alertView show]; - } else { - [RCDHTTPTOOL requestFriend:_targetUserInfo.userId - complete:^(BOOL result) { - if (result) { - UIAlertView *alertView = [[UIAlertView alloc] - initWithTitle:nil - message:@"请求已发送" - delegate:nil - cancelButtonTitle:@"确定" - otherButtonTitles:nil, nil]; - [RCDHTTPTOOL getFriendscomplete:^(NSMutableArray *result) { - }]; - [alertView show]; - } else { - UIAlertView *alertView = [[UIAlertView alloc] - initWithTitle:nil - message:@"请求失败,请重试" - delegate:nil - cancelButtonTitle:@"确定" - otherButtonTitles:nil, nil]; - [alertView show]; - } - }]; - } + if (_targetUserInfo) { + RCDUserInfo *friend = [[RCDataBaseManager shareInstance] getFriendInfo:_targetUserInfo.userId]; + + if (friend && [friend.status isEqualToString:@"10"]) { + UIAlertView *alertView = [[UIAlertView alloc] + initWithTitle:nil + message:@"已发送好友邀请" + delegate:nil + cancelButtonTitle:@"确定" + otherButtonTitles:nil, nil]; + [alertView show]; + } else { + [RCDHTTPTOOL requestFriend:_targetUserInfo.userId + complete:^(BOOL result) { + if (result) { + UIAlertView *alertView = [[UIAlertView alloc] + initWithTitle:nil + message:@"请求已发送" + delegate:nil + cancelButtonTitle:@"确定" + otherButtonTitles:nil, nil]; + [RCDHTTPTOOL getFriendscomplete:^(NSMutableArray *result) { + }]; + [alertView show]; + } else { + UIAlertView *alertView = [[UIAlertView alloc] + initWithTitle:nil + message:@"请求失败,请重试" + delegate:nil + cancelButtonTitle:@"确定" + otherButtonTitles:nil, nil]; + [alertView show]; + } + }]; + } + + }; } - (void)actionStartChat:(id)sender { diff --git a/ios-rongimdemo/RCloudMessage/AppDelegate.m b/ios-rongimdemo/RCloudMessage/AppDelegate.m index c13799ec..debcdc4e 100644 --- a/ios-rongimdemo/RCloudMessage/AppDelegate.m +++ b/ios-rongimdemo/RCloudMessage/AppDelegate.m @@ -694,6 +694,15 @@ - (void)onRCIMConnectionStatusChanged:(RCConnectionStatus)status { } } +-(BOOL)onRCIMCustomLocalNotification:(RCMessage*)message + withSenderName:(NSString *)senderName{ + //群组通知不弹本地通知 + if ([message.content isKindOfClass:[RCGroupNotificationMessage class]]) { + return YES; + } + return NO; +} + - (void)onRCIMReceiveMessage:(RCMessage *)message left:(int)left { if ([message.content isMemberOfClass:[RCInformationNotificationMessage class]]) { diff --git a/ios-rongimdemo/RCloudMessage/Info.plist b/ios-rongimdemo/RCloudMessage/Info.plist index 907e230c..b48cec9a 100644 --- a/ios-rongimdemo/RCloudMessage/Info.plist +++ b/ios-rongimdemo/RCloudMessage/Info.plist @@ -42,7 +42,7 @@ CFBundleVersion - 201703021813 + 201703061605 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/ios-rongimdemo/framework/RongCallKit.framework/RongCallKit b/ios-rongimdemo/framework/RongCallKit.framework/RongCallKit index 4b6a6fa3..75a9764a 100644 Binary files a/ios-rongimdemo/framework/RongCallKit.framework/RongCallKit and b/ios-rongimdemo/framework/RongCallKit.framework/RongCallKit differ diff --git a/ios-rongimdemo/framework/RongCallLib.framework/RongCallLib b/ios-rongimdemo/framework/RongCallLib.framework/RongCallLib index 8931a896..5feede9d 100644 Binary files a/ios-rongimdemo/framework/RongCallLib.framework/RongCallLib and b/ios-rongimdemo/framework/RongCallLib.framework/RongCallLib differ diff --git a/ios-rongimdemo/framework/RongIMKit.framework/RongIMKit b/ios-rongimdemo/framework/RongIMKit.framework/RongIMKit index 8f2cf246..f29a35c1 100644 Binary files a/ios-rongimdemo/framework/RongIMKit.framework/RongIMKit and b/ios-rongimdemo/framework/RongIMKit.framework/RongIMKit differ diff --git a/ios-rongimdemo/framework/RongIMLib.framework/RongIMLib b/ios-rongimdemo/framework/RongIMLib.framework/RongIMLib index 97ddf446..9bf2e45b 100644 Binary files a/ios-rongimdemo/framework/RongIMLib.framework/RongIMLib and b/ios-rongimdemo/framework/RongIMLib.framework/RongIMLib differ diff --git a/ios-rongimdemo/framework/RongiFlyKit.framework/RongiFlyKit b/ios-rongimdemo/framework/RongiFlyKit.framework/RongiFlyKit index ef102b85..24edaef9 100644 Binary files a/ios-rongimdemo/framework/RongiFlyKit.framework/RongiFlyKit and b/ios-rongimdemo/framework/RongiFlyKit.framework/RongiFlyKit differ diff --git "a/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" "b/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" index 9e0a10d8..882a0299 100644 --- "a/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" +++ "b/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 201703021813 + 201703061605 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git "a/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" "b/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" index aa60ff94..d16b928f 100644 --- "a/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" +++ "b/ios-rongimdemo/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 201703021813 + 201703061605 NSExtension NSExtensionAttributes