删除了发送自定义消息的helper
This commit is contained in:
@@ -192,7 +192,6 @@
|
|||||||
E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36B2743951B00E1EBED /* GiftReceiveInfoModel.m */; };
|
E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36B2743951B00E1EBED /* GiftReceiveInfoModel.m */; };
|
||||||
E884C36F2743AAC800E1EBED /* AttachmentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36E2743AAC800E1EBED /* AttachmentModel.m */; };
|
E884C36F2743AAC800E1EBED /* AttachmentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36E2743AAC800E1EBED /* AttachmentModel.m */; };
|
||||||
E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */; };
|
E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */; };
|
||||||
E884C37B2743B6E900E1EBED /* IMMessageHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C37A2743B6E900E1EBED /* IMMessageHelper.m */; };
|
|
||||||
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; };
|
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; };
|
||||||
E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; };
|
E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; };
|
||||||
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CAC26FB16A800DA9178 /* XPMineTeenagerDesView.m */; };
|
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CAC26FB16A800DA9178 /* XPMineTeenagerDesView.m */; };
|
||||||
@@ -671,8 +670,6 @@
|
|||||||
E884C36E2743AAC800E1EBED /* AttachmentModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AttachmentModel.m; sourceTree = "<group>"; };
|
E884C36E2743AAC800E1EBED /* AttachmentModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AttachmentModel.m; sourceTree = "<group>"; };
|
||||||
E884C3702743AEDE00E1EBED /* CustomAttachmentDecoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomAttachmentDecoder.h; sourceTree = "<group>"; };
|
E884C3702743AEDE00E1EBED /* CustomAttachmentDecoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomAttachmentDecoder.h; sourceTree = "<group>"; };
|
||||||
E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomAttachmentDecoder.m; sourceTree = "<group>"; };
|
E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomAttachmentDecoder.m; sourceTree = "<group>"; };
|
||||||
E884C3792743B6E900E1EBED /* IMMessageHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMMessageHelper.h; sourceTree = "<group>"; };
|
|
||||||
E884C37A2743B6E900E1EBED /* IMMessageHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMMessageHelper.m; sourceTree = "<group>"; };
|
|
||||||
E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = "<group>"; };
|
E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = "<group>"; };
|
||||||
E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineTeenagerViewController.m; sourceTree = "<group>"; };
|
E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineTeenagerViewController.m; sourceTree = "<group>"; };
|
||||||
E88B5CA626FB089C00DA9178 /* XPMineTeenagePwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagePwdViewController.h; sourceTree = "<group>"; };
|
E88B5CA626FB089C00DA9178 /* XPMineTeenagePwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagePwdViewController.h; sourceTree = "<group>"; };
|
||||||
@@ -1914,8 +1911,6 @@
|
|||||||
children = (
|
children = (
|
||||||
E884C3702743AEDE00E1EBED /* CustomAttachmentDecoder.h */,
|
E884C3702743AEDE00E1EBED /* CustomAttachmentDecoder.h */,
|
||||||
E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */,
|
E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */,
|
||||||
E884C3792743B6E900E1EBED /* IMMessageHelper.h */,
|
|
||||||
E884C37A2743B6E900E1EBED /* IMMessageHelper.m */,
|
|
||||||
);
|
);
|
||||||
path = Tool;
|
path = Tool;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -2825,7 +2820,6 @@
|
|||||||
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
|
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
|
||||||
E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */,
|
E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */,
|
||||||
189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */,
|
189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */,
|
||||||
E884C37B2743B6E900E1EBED /* IMMessageHelper.m in Sources */,
|
|
||||||
189DD74526E21CCC00AB55B1 /* YYReachability.m in Sources */,
|
189DD74526E21CCC00AB55B1 /* YYReachability.m in Sources */,
|
||||||
E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */,
|
E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */,
|
||||||
E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */,
|
E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */,
|
||||||
|
@@ -1,30 +0,0 @@
|
|||||||
//
|
|
||||||
// IMMessageHelper.h
|
|
||||||
// xplan-ios
|
|
||||||
//
|
|
||||||
// Created by 冯硕 on 2021/11/16.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <NIMSDK/NIMSDK.h>
|
|
||||||
#import "AttachmentModel.h"
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
///发送消息的工具类
|
|
||||||
@class UserInfoModel;
|
|
||||||
@interface IMMessageHelper : NSObject
|
|
||||||
|
|
||||||
|
|
||||||
/// 发送自定义消息
|
|
||||||
/// @param attachment 自定消息的内容
|
|
||||||
/// @param sessionId 回话ID
|
|
||||||
/// @param type 回话的类型
|
|
||||||
/// @pararm userInfo 当前的用户
|
|
||||||
+ (void)sendCustomMessage:(AttachmentModel *)attachment
|
|
||||||
sessionId:(NSString *)sessionId
|
|
||||||
type:(NIMSessionType)type
|
|
||||||
userInfo:(UserInfoModel *)userInfo;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@@ -1,63 +0,0 @@
|
|||||||
//
|
|
||||||
// IMMessageHelper.m
|
|
||||||
// xplan-ios
|
|
||||||
//
|
|
||||||
// Created by 冯硕 on 2021/11/16.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "IMMessageHelper.h"
|
|
||||||
#import "UserInfoModel.h"
|
|
||||||
|
|
||||||
@implementation IMMessageHelper
|
|
||||||
|
|
||||||
/// 发送自定义消息
|
|
||||||
/// @param attachment 自定消息的内容
|
|
||||||
/// @param sessionId 回话ID
|
|
||||||
/// @param type 回话的类型
|
|
||||||
+ (void)sendCustomMessage:(AttachmentModel *)attachment
|
|
||||||
sessionId:(NSString *)sessionId
|
|
||||||
type:(NIMSessionType)type
|
|
||||||
userInfo:(UserInfoModel *)userInfo {
|
|
||||||
NIMMessage *message = [[NIMMessage alloc]init];
|
|
||||||
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
|
||||||
object.attachment = attachment;
|
|
||||||
message.messageObject = object;
|
|
||||||
//yidun
|
|
||||||
NIMAntiSpamOption *option = [NIMAntiSpamOption new];
|
|
||||||
option.yidunEnabled =NO;
|
|
||||||
message.antiSpamOption = option;
|
|
||||||
|
|
||||||
NIMMessageSetting *setting = [[NIMMessageSetting alloc]init];
|
|
||||||
setting.apnsEnabled = NO;
|
|
||||||
message.setting = setting;
|
|
||||||
|
|
||||||
if (type == NIMSessionTypeChatroom) {
|
|
||||||
message.remoteExt = [self makeMessageRemoteExt:userInfo];
|
|
||||||
}
|
|
||||||
//构造会话
|
|
||||||
NIMSession *session = [NIMSession session:sessionId type:type];
|
|
||||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
///构造消息的自定义扩展字段
|
|
||||||
+ (NSDictionary *)makeMessageRemoteExt:(UserInfoModel *)userInfo {
|
|
||||||
NSMutableDictionary * remoteExt = [NSMutableDictionary dictionary];
|
|
||||||
if (userInfo.erbanNo) {
|
|
||||||
[remoteExt setValue:[NSString stringWithFormat:@"%ld", userInfo.erbanNo] forKey:@"erbanNo"];
|
|
||||||
}
|
|
||||||
[remoteExt setValue:@(userInfo.defUser) forKey:@"defUser"];
|
|
||||||
[remoteExt setValue:@(userInfo.newUser) forKey:@"newUser"];
|
|
||||||
[remoteExt setValue:@(userInfo.hasPrettyErbanNo) forKey:@"hasPrettyErbanNo"];
|
|
||||||
[remoteExt setValue:userInfo.defUser == UserLevelType_Offical ? @(YES) : @(NO) forKey:@"official"];
|
|
||||||
if (userInfo.userLevelVo.charmUrl.length > 0) {
|
|
||||||
[remoteExt setValue:userInfo.userLevelVo.charmUrl forKey:@"charmUrl"];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (userInfo.userLevelVo.experUrl.length > 0) {
|
|
||||||
[remoteExt setValue:userInfo.userLevelVo.experUrl forKey:@"experUrl"];
|
|
||||||
}
|
|
||||||
return remoteExt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@@ -15,7 +15,6 @@
|
|||||||
#import "TTPopup.h"
|
#import "TTPopup.h"
|
||||||
#import "ThemeColor+SendGift.h"
|
#import "ThemeColor+SendGift.h"
|
||||||
#import "XCHUDTool.h"
|
#import "XCHUDTool.h"
|
||||||
#import "IMMessageHelper.h"
|
|
||||||
///Model
|
///Model
|
||||||
#import "GiftInfoModel.h"
|
#import "GiftInfoModel.h"
|
||||||
#import "XPGiftCountModel.h"
|
#import "XPGiftCountModel.h"
|
||||||
@@ -96,7 +95,6 @@
|
|||||||
- (void)sendCustomMessage:(GiftReceiveInfoModel *)receiveModel oringinDic:(NSDictionary *)originDic {
|
- (void)sendCustomMessage:(GiftReceiveInfoModel *)receiveModel oringinDic:(NSDictionary *)originDic {
|
||||||
AttachmentModel *attachement = [[AttachmentModel alloc] init];
|
AttachmentModel *attachement = [[AttachmentModel alloc] init];
|
||||||
NSDictionary * dict = originDic;
|
NSDictionary * dict = originDic;
|
||||||
NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId];
|
|
||||||
UserInfoModel * userInfo = [self.delegate getUserInfo];
|
UserInfoModel * userInfo = [self.delegate getUserInfo];
|
||||||
if (receiveModel.roomSendGiftType == RoomSendGiftType_AllMic) { // 全麦
|
if (receiveModel.roomSendGiftType == RoomSendGiftType_AllMic) { // 全麦
|
||||||
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
||||||
@@ -115,7 +113,7 @@
|
|||||||
[data removeObjectForKey:@"luckyBagGifts"];
|
[data removeObjectForKey:@"luckyBagGifts"];
|
||||||
[data removeObjectForKey:@"targetUsers"];
|
[data removeObjectForKey:@"targetUsers"];
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}else { // 全麦赠送普通礼物 包含背包礼物
|
}else { // 全麦赠送普通礼物 包含背包礼物
|
||||||
@@ -123,7 +121,7 @@
|
|||||||
attachement.second = Custom_Message_Sub_AllMicroSend;
|
attachement.second = Custom_Message_Sub_AllMicroSend;
|
||||||
[data setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"];
|
[data setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"];
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}
|
}
|
||||||
} else if (receiveModel.roomSendGiftType == RoomSendGiftType_MutableOnMic) { // 多人非全麦
|
} else if (receiveModel.roomSendGiftType == RoomSendGiftType_MutableOnMic) { // 多人非全麦
|
||||||
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
||||||
@@ -143,14 +141,14 @@
|
|||||||
[data removeObjectForKey:@"luckyBagGifts"];
|
[data removeObjectForKey:@"luckyBagGifts"];
|
||||||
[data removeObjectForKey:@"targetUsers"];
|
[data removeObjectForKey:@"targetUsers"];
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}else { // 多人非全麦 普通礼物
|
}else { // 多人非全麦 普通礼物
|
||||||
attachement.first = CustomMessageType_ALLMicroSend;
|
attachement.first = CustomMessageType_ALLMicroSend;
|
||||||
attachement.second = Custom_Message_Sub_AllBatchSend;
|
attachement.second = Custom_Message_Sub_AllBatchSend;
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}
|
}
|
||||||
} else if (receiveModel.roomSendGiftType == RoomSendGiftType_ToOne) { // 单人
|
} else if (receiveModel.roomSendGiftType == RoomSendGiftType_ToOne) { // 单人
|
||||||
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
NSMutableDictionary *data = [NSMutableDictionary dictionary];
|
||||||
@@ -169,7 +167,7 @@
|
|||||||
[data removeObjectForKey:@"luckyBagGifts"];
|
[data removeObjectForKey:@"luckyBagGifts"];
|
||||||
[data removeObjectForKey:@"targetUsers"];
|
[data removeObjectForKey:@"targetUsers"];
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}];
|
}];
|
||||||
}else { // 一对一 普通礼物
|
}else { // 一对一 普通礼物
|
||||||
attachement.first = CustomMessageType_Gift;
|
attachement.first = CustomMessageType_Gift;
|
||||||
@@ -179,12 +177,23 @@
|
|||||||
[data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"];
|
[data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"];
|
||||||
[data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"];
|
[data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"];
|
||||||
attachement.data = data;
|
attachement.data = data;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
[self sendCustomMessage:attachement];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)sendCustomMessage:(AttachmentModel *)attachment {
|
||||||
|
NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId];
|
||||||
|
NIMMessage *message = [[NIMMessage alloc]init];
|
||||||
|
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||||
|
object.attachment = attachment;
|
||||||
|
message.messageObject = object;
|
||||||
|
//构造会话
|
||||||
|
NIMSession *session = [NIMSession session:sessionID type:NIMSessionTypeChatroom];
|
||||||
|
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Deal Send Gift Data
|
#pragma mark - Deal Send Gift Data
|
||||||
- (NSString *)dealSendGiftCount:(XPGiftCountModel *)model gift:(GiftInfoModel *)gift {
|
- (NSString *)dealSendGiftCount:(XPGiftCountModel *)model gift:(GiftInfoModel *)gift {
|
||||||
NSString * count = @"1";
|
NSString * count = @"1";
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#import "RoomHeaderView.h"
|
#import "RoomHeaderView.h"
|
||||||
///Third
|
///Third
|
||||||
|
#import <NIMSDK/NIMSDK.h>
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <MarqueeLabel.h>
|
#import <MarqueeLabel.h>
|
||||||
#import <YYText/YYLabel.h>
|
#import <YYText/YYLabel.h>
|
||||||
@@ -21,7 +22,6 @@
|
|||||||
#import "XPHtmlUrl.h"
|
#import "XPHtmlUrl.h"
|
||||||
#import "ApiHost.h"
|
#import "ApiHost.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "IMMessageHelper.h"
|
|
||||||
#import "HttpRequestHelper.h"
|
#import "HttpRequestHelper.h"
|
||||||
///Model
|
///Model
|
||||||
#import "RoomInfoModel.h"
|
#import "RoomInfoModel.h"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#import "XPWebViewcontroller.h"
|
#import "XPWebViewcontroller.h"
|
||||||
|
|
||||||
|
|
||||||
@interface RoomHeaderView ()<XCShareViewDelegate, BaseViewControllerProtocol>
|
@interface RoomHeaderView ()<XCShareViewDelegate>
|
||||||
///返回按钮
|
///返回按钮
|
||||||
@property (nonatomic,strong) UIButton *backButton;
|
@property (nonatomic,strong) UIButton *backButton;
|
||||||
///容器
|
///容器
|
||||||
@@ -236,7 +236,14 @@
|
|||||||
[dic setValue:userDic forKey:@"data"];
|
[dic setValue:userDic forKey:@"data"];
|
||||||
attachMent.data = dic;
|
attachMent.data = dic;
|
||||||
NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId];
|
NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId];
|
||||||
[IMMessageHelper sendCustomMessage:attachMent sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
|
|
||||||
|
NIMMessage *message = [[NIMMessage alloc]init];
|
||||||
|
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||||
|
object.attachment = attachMent;
|
||||||
|
message.messageObject = object;
|
||||||
|
//构造会话
|
||||||
|
NIMSession *session = [NIMSession session:sessionID type:NIMSessionTypeChatroom];
|
||||||
|
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||||
///上报一下
|
///上报一下
|
||||||
[self saveShare:shareInfo];
|
[self saveShare:shareInfo];
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
///Tool
|
///Tool
|
||||||
#import "XPMacro.h"
|
#import "XPMacro.h"
|
||||||
#import "ThemeColor+UserCard.h"
|
#import "ThemeColor+UserCard.h"
|
||||||
#import "IMMessageHelper.h"
|
|
||||||
#import "TTPopup.h"
|
#import "TTPopup.h"
|
||||||
#import "XPHtmlUrl.h"
|
#import "XPHtmlUrl.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
@@ -323,7 +322,14 @@
|
|||||||
attachment.second = second;
|
attachment.second = second;
|
||||||
attachment.data = [notifyModel model2dictionary];
|
attachment.data = [notifyModel model2dictionary];
|
||||||
NSString * sessionId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
NSString * sessionId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
||||||
[IMMessageHelper sendCustomMessage:attachment sessionId:sessionId type:NIMSessionTypeChatroom userInfo:userInfo];
|
|
||||||
|
NIMMessage *message = [[NIMMessage alloc]init];
|
||||||
|
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||||
|
object.attachment = attachment;
|
||||||
|
message.messageObject = object;
|
||||||
|
//构造会话
|
||||||
|
NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom];
|
||||||
|
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -515,7 +521,14 @@
|
|||||||
attachement.first = CustomMessageType_Queue;
|
attachement.first = CustomMessageType_Queue;
|
||||||
attachement.second = Custom_Message_Sub_Queue_Invite;
|
attachement.second = Custom_Message_Sub_Queue_Invite;
|
||||||
attachement.data = dic;
|
attachement.data = dic;
|
||||||
[IMMessageHelper sendCustomMessage:attachement sessionId:roomId type:NIMSessionTypeChatroom userInfo:self.targetUserInfo];
|
|
||||||
|
NIMMessage *message = [[NIMMessage alloc]init];
|
||||||
|
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||||
|
object.attachment = attachement;
|
||||||
|
message.messageObject = object;
|
||||||
|
//构造会话
|
||||||
|
NIMSession *session = [NIMSession session:roomId type:NIMSessionTypeChatroom];
|
||||||
|
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user