Commit 4bd5bb5a199758e6d989454fa17d715d7e4800d5

Authored by 王军波
1 parent 53b20214

添加信息ID

CNLiveChatSDKDemo/CNLiveChatManager.framework/CNLiveChatManager
No preview for this file type
CNLiveChatSDKDemo/CNLiveChatManager.framework/Headers/CNLiveChatManager.h
... ... @@ -43,7 +43,7 @@
43 43 /**
44 44 接收消息监听
45 45  
46   - @param message 消息实体类型对象
  46 + @param message 消息实体类型对象(包括消息内容,消息ID,会话类型,目标ID,发送者的用户信息)
47 47 */
48 48 - (void)onReceived:(CNLiveChatMessage *)message;
49 49  
... ... @@ -185,14 +185,14 @@
185 185 @param message 消息内容
186 186 @param type 会话类型(私聊 / 聊天室)
187 187 @param targetId 会话目标ID(私聊:用户ID / 聊天室:聊天室ID)
188   - @param successBlock 发送消息成功的回调,返回目标ID,消息实体类型对象(包括消息内容,会话类型,目标ID,发送者的用户信息)
189   - @param errorBlock 发送消息失败的回调,返回错误码,目标ID,会话类型
  188 + @param successBlock 发送消息成功的回调,消息实体类型对象(包括消息内容,消息ID,会话类型,目标ID,发送者的用户信息)
  189 + @param errorBlock 发送消息失败的回调,返回错误码,消息ID,目标ID
190 190 */
191 191 - (void)sendMessage:(NSString *)message
192 192 type:(CNLiveConversationType)type
193 193 targetId:(NSString *)targetId
194   - success:(void (^)(NSString *targetId, CNLiveChatMessage *message))successBlock
195   - error:(void (^)(CNLiveChatErrorCode errors, NSString *targetId, CNLiveConversationType type))errorBlock;
  194 + success:(void (^)(CNLiveChatMessage *message))successBlock
  195 + error:(void (^)(CNLiveChatErrorCode errors, NSString *messageId, NSString *targetId))errorBlock;
196 196  
197 197  
198 198 /**
... ...
CNLiveChatSDKDemo/CNLiveChatManager.framework/Headers/CNLiveChatMessage.h
... ... @@ -23,6 +23,11 @@
23 23 @property (nonatomic, assign) NSString *targetId;
24 24  
25 25 /**
  26 + 消息ID(本地存储的消息的唯一值(数据库索引唯一值))
  27 + */
  28 +@property (nonatomic, assign) NSString *messageId;
  29 +
  30 +/**
26 31 消息内容
27 32 */
28 33 @property (nonatomic, strong) NSString *messageContent;
... ...
CNLiveChatSDKDemo/CNLiveChatManager.framework/Info.plist
No preview for this file type
CNLiveChatSDKDemo/CNLiveChatSDKDemo.xcodeproj/project.pbxproj
... ... @@ -7,16 +7,15 @@
7 7 objects = {
8 8  
9 9 /* Begin PBXBuildFile section */
10   - D22551F41E79436D0056B231 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D22551F31E79436D0056B231 /* CNLiveMsgTools.framework */; };
11   - D22551F61E7943740056B231 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D22551F51E7943740056B231 /* CNLiveChatManager.framework */; };
12   - D22551F71E79437C0056B231 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D22551F31E79436D0056B231 /* CNLiveMsgTools.framework */; };
13   - D22551F81E79437C0056B231 /* CNLiveMsgTools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D22551F31E79436D0056B231 /* CNLiveMsgTools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14   - D225520B1E794A270056B231 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D225520A1E794A270056B231 /* CNLiveChatManager.framework */; };
15   - D225520C1E794A2C0056B231 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D225520A1E794A270056B231 /* CNLiveChatManager.framework */; };
16   - D225520D1E794A2C0056B231 /* CNLiveChatManager.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D225520A1E794A270056B231 /* CNLiveChatManager.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 10 D231941F1E70101500111C3B /* MessageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D231941E1E70101500111C3B /* MessageModel.m */; };
18 11 D231C8A61E6FFC2700EAC427 /* ChatRoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D231C8A51E6FFC2700EAC427 /* ChatRoomViewController.m */; };
19 12 D231C8A91E6FFD3100EAC427 /* PrivateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D231C8A81E6FFD3100EAC427 /* PrivateViewController.m */; };
  13 + D25BF8671E7A6519007FB138 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8661E7A6519007FB138 /* CNLiveMsgTools.framework */; };
  14 + D25BF8691E7A6520007FB138 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8681E7A6520007FB138 /* CNLiveChatManager.framework */; };
  15 + D25BF86A1E7A6686007FB138 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8661E7A6519007FB138 /* CNLiveMsgTools.framework */; };
  16 + D25BF86B1E7A6686007FB138 /* CNLiveMsgTools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8661E7A6519007FB138 /* CNLiveMsgTools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
  17 + D25BF86C1E7A6688007FB138 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8681E7A6520007FB138 /* CNLiveChatManager.framework */; };
  18 + D25BF86D1E7A6688007FB138 /* CNLiveChatManager.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D25BF8681E7A6520007FB138 /* CNLiveChatManager.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
20 19 D264D5A51E6FDE02002CDF41 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D264D5A41E6FDE02002CDF41 /* main.m */; };
21 20 D264D5A81E6FDE02002CDF41 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D264D5A71E6FDE02002CDF41 /* AppDelegate.m */; };
22 21 D264D5AB1E6FDE02002CDF41 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D264D5AA1E6FDE02002CDF41 /* ViewController.m */; };
... ... @@ -32,8 +31,8 @@
32 31 dstPath = "";
33 32 dstSubfolderSpec = 10;
34 33 files = (
35   - D22551F81E79437C0056B231 /* CNLiveMsgTools.framework in Embed Frameworks */,
36   - D225520D1E794A2C0056B231 /* CNLiveChatManager.framework in Embed Frameworks */,
  34 + D25BF86B1E7A6686007FB138 /* CNLiveMsgTools.framework in Embed Frameworks */,
  35 + D25BF86D1E7A6688007FB138 /* CNLiveChatManager.framework in Embed Frameworks */,
37 36 );
38 37 name = "Embed Frameworks";
39 38 runOnlyForDeploymentPostprocessing = 0;
... ... @@ -41,15 +40,14 @@
41 40 /* End PBXCopyFilesBuildPhase section */
42 41  
43 42 /* Begin PBXFileReference section */
44   - D22551F31E79436D0056B231 /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; };
45   - D22551F51E7943740056B231 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CNLiveChatManager.framework; path = /Users/cnlive/Desktop/CNLiveChatManagerSDKDemo/CNLiveChatSDKDemo/CNLiveChatManager.framework; sourceTree = "<absolute>"; };
46   - D225520A1E794A270056B231 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; };
47 43 D231941D1E70101500111C3B /* MessageModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageModel.h; sourceTree = "<group>"; };
48 44 D231941E1E70101500111C3B /* MessageModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageModel.m; sourceTree = "<group>"; };
49 45 D231C8A41E6FFC2700EAC427 /* ChatRoomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatRoomViewController.h; sourceTree = "<group>"; };
50 46 D231C8A51E6FFC2700EAC427 /* ChatRoomViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatRoomViewController.m; sourceTree = "<group>"; };
51 47 D231C8A71E6FFD3100EAC427 /* PrivateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrivateViewController.h; sourceTree = "<group>"; };
52 48 D231C8A81E6FFD3100EAC427 /* PrivateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrivateViewController.m; sourceTree = "<group>"; };
  49 + D25BF8661E7A6519007FB138 /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; };
  50 + D25BF8681E7A6520007FB138 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; };
53 51 D264D5A01E6FDE02002CDF41 /* CNLiveChatSDKDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveChatSDKDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
54 52 D264D5A41E6FDE02002CDF41 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
55 53 D264D5A61E6FDE02002CDF41 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
... ... @@ -68,11 +66,10 @@
68 66 isa = PBXFrameworksBuildPhase;
69 67 buildActionMask = 2147483647;
70 68 files = (
71   - D22551F41E79436D0056B231 /* CNLiveMsgTools.framework in Frameworks */,
72   - D22551F61E7943740056B231 /* CNLiveChatManager.framework in Frameworks */,
73   - D225520C1E794A2C0056B231 /* CNLiveChatManager.framework in Frameworks */,
74   - D22551F71E79437C0056B231 /* CNLiveMsgTools.framework in Frameworks */,
75   - D225520B1E794A270056B231 /* CNLiveChatManager.framework in Frameworks */,
  69 + D25BF8671E7A6519007FB138 /* CNLiveMsgTools.framework in Frameworks */,
  70 + D25BF8691E7A6520007FB138 /* CNLiveChatManager.framework in Frameworks */,
  71 + D25BF86A1E7A6686007FB138 /* CNLiveMsgTools.framework in Frameworks */,
  72 + D25BF86C1E7A6688007FB138 /* CNLiveChatManager.framework in Frameworks */,
76 73 );
77 74 runOnlyForDeploymentPostprocessing = 0;
78 75 };
... ... @@ -104,8 +101,8 @@
104 101 D264D5971E6FDE02002CDF41 = {
105 102 isa = PBXGroup;
106 103 children = (
107   - D225520A1E794A270056B231 /* CNLiveChatManager.framework */,
108   - D22551F31E79436D0056B231 /* CNLiveMsgTools.framework */,
  104 + D25BF8681E7A6520007FB138 /* CNLiveChatManager.framework */,
  105 + D25BF8661E7A6519007FB138 /* CNLiveMsgTools.framework */,
109 106 D264D5A21E6FDE02002CDF41 /* CNLiveChatSDKDemo */,
110 107 D264D5A11E6FDE02002CDF41 /* Products */,
111 108 );
... ...
CNLiveChatSDKDemo/CNLiveChatSDKDemo/ChatRoomViewController.m
... ... @@ -131,9 +131,9 @@ static NSString *cellId = @&quot;cellId&quot;;
131 131 #pragma mark - UITextFieldDelegate !!!!!!!!!!!!!!!!!!!!!!!!!!
132 132 - (BOOL)textFieldShouldReturn:(UITextField *)textField { // 发送消息
133 133  
134   - [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:textField.text type:CNLive_ConversationType_CHATROOM targetId:@"7788" success:^(NSString *targetId, CNLiveChatMessage *message) {
  134 + [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:textField.text type:CNLive_ConversationType_CHATROOM targetId:@"60_7788" success:^(CNLiveChatMessage *message) {
135 135  
136   - NSLog(@"发送消息成功:%@",message);
  136 + NSLog(@"发送消息成功:%@",message.messageId);
137 137 // 自己发送的消息不会被onReceived:方法实时监听,需要自己做处理
138 138 MessageModel *model = [[MessageModel alloc] init];
139 139  
... ... @@ -143,6 +143,7 @@ static NSString *cellId = @&quot;cellId&quot;;
143 143 model.name = userInfo.name;
144 144 model.portraitUri = userInfo.portraitUri;
145 145 model.type = CNLive_ConversationType_CHATROOM;
  146 + model.messageId = message.messageId;
146 147  
147 148 [_messageArrayM addObject:model];
148 149  
... ... @@ -154,9 +155,9 @@ static NSString *cellId = @&quot;cellId&quot;;
154 155 [self scrollToBottom];
155 156 });
156 157  
157   - } error:^(CNLiveChatErrorCode errors, NSString *targetId, CNLiveConversationType type) {
  158 + } error:^(CNLiveChatErrorCode errors, NSString *messageId, NSString *targetId) {
158 159  
159   - NSLog(@"向:%@发送消息失败,错误代码:%ld",targetId,(long)errors);
  160 + NSLog(@"向聊天室:%@发送消息失败,错误代码:%ld,信息ID:%@",targetId,(long)errors,messageId);
160 161 }];
161 162  
162 163 _messageSelf = textField.text;
... ...
CNLiveChatSDKDemo/CNLiveChatSDKDemo/MessageModel.h
... ... @@ -14,6 +14,8 @@
14 14  
15 15 @property (nonatomic, strong) NSString *targetId;
16 16  
  17 +@property (nonatomic, strong) NSString *messageId;
  18 +
17 19 @property (nonatomic, strong) NSString *userId;
18 20  
19 21 @property (nonatomic, strong) NSString *name;
... ...
CNLiveChatSDKDemo/CNLiveChatSDKDemo/PrivateViewController.m
... ... @@ -117,7 +117,7 @@ static NSString *priCellId = @&quot;priCellId&quot;;
117 117 #pragma mark - UITextFieldDelegate !!!!!!!!!!!!!!!!!!!!!!!!!!
118 118 - (BOOL)textFieldShouldReturn:(UITextField *)textField { // 发送消息
119 119  
120   - [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:textField.text type:CNLive_ConversationType_PRIVATE targetId:@"20170311" success:^(NSString *targetId, CNLiveChatMessage *message) {
  120 + [[CNLiveChatManager sharedCNLiveChatManager] sendMessage:textField.text type:CNLive_ConversationType_PRIVATE targetId:@"20170311" success:^(CNLiveChatMessage *message) {
121 121  
122 122 NSLog(@"发送消息成功:%@",message);
123 123 // 自己发送的消息不会被onReceived:方法实时监听,需要自己做处理
... ... @@ -129,6 +129,7 @@ static NSString *priCellId = @&quot;priCellId&quot;;
129 129 model.name = userInfo.name;
130 130 model.portraitUri = userInfo.portraitUri;
131 131 model.type = CNLive_ConversationType_CHATROOM;
  132 + model.messageId = message.messageId;
132 133  
133 134 [_messageArrayM addObject:model];
134 135  
... ... @@ -140,9 +141,9 @@ static NSString *priCellId = @&quot;priCellId&quot;;
140 141 [self scrollToBottom];
141 142 });
142 143  
143   - } error:^(CNLiveChatErrorCode errors, NSString *targetId, CNLiveConversationType type) {
  144 + } error:^(CNLiveChatErrorCode errors, NSString *messageId, NSString *targetId) {
144 145  
145   - NSLog(@"向:%@发送消息失败,错误代码:%ld",targetId,(long)errors);
  146 + NSLog(@"向:%@发送消息失败,错误代码:%ld,信息ID:%@",targetId,(long)errors,messageId);
146 147 }];
147 148  
148 149 _messageSelf = textField.text;
... ...
CNLiveChatSDKDemo/CNLiveMsgTools.framework/CNLiveMsgTools
No preview for this file type
CNLiveChatSDKDemo/CNLiveMsgTools.framework/Headers/CNLiveMsgManager.h
... ... @@ -71,8 +71,8 @@
71 71 - (void)sendCarrier:(NSString *)carrier
72 72 type:(NSInteger)type
73 73 targetId:(NSString *)targetId
74   - success:(void (^)(NSString *carrier, NSString *targetId, NSInteger type, NSString *infoId, NSString *infoName, NSString *infoUrl))successBlock
75   - error:(void (^)(NSInteger errors, NSString *targetId, NSInteger type))errorBlock;
  74 + success:(void (^)(NSString *carrier, NSString *messageId, NSString *targetId, NSInteger type, NSString *infoId, NSString *infoName, NSString *infoUrl))successBlock
  75 + error:(void (^)(NSInteger errors, NSString *messageId, NSString *targetId))errorBlock;
76 76  
77 77  
78 78 - (NSInteger)getOnLineStatus;
... ...