ios - Quickblox chatRoomDidReceiveMessage 没有调用
<p><p>我遇到了一个问题,我在群组类型 <code>QBChatDialogTypeGroup</code> 中聊天时没有收到消息。
我正在使用下面的代码消息发送成功并收到通知其他群组成员,但是群组聊天 View 中的用户无法调用这些方法然后收到消息。 </p>
<pre><code>- (void)chatRoomDidReceiveMessage:(QBChatMessage *)message fromRoomJID:(NSString *)roomJID{
}
- (void)chatDidNotSendMessage:(QBChatMessage *)message toRoomJid:(NSString *)roomJid error:(NSError *)error{
}
QBChatDialog *groupChatDialog = qbchatDialog;
[ delegates];
QBChatMessage *message = ;
;
];
message.markable =YES;
message.senderNick=[ valueForKey:@"name"];
NSMutableDictionary *params = ;
params[@"save_to_history"] = @YES;
;
[groupChatDialog joinWithCompletionBlock:^(NSError * _Nullable error) {
[privateChatDialog sendMessage:message completionBlock:^(NSError * _Nullable error) {
}];
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>请使用 addDelegate: 方法订阅聊天通知:</p>
<pre><code>[ addDelegate:self];
</code></pre>
<p>并实现 QBChatDelegate 协议(protocol)方法(可选):</p>
<pre><code>- (void)chatDidReceiveMessage:(QB_NONNULL QBChatMessage *)message;
- (void)chatDidReceiveSystemMessage:(QB_NONNULL QBChatMessage *)message;
- (void)chatRoomDidReceiveMessage:(QB_NONNULL QBChatMessage *)message fromDialogID:(QB_NONNULL NSString *)dialogID;
</code></pre>
<p> <a href="http://quickblox.com/developers/SimpleSample-chat_users-ios#Create_new_dialog" rel="noreferrer noopener nofollow">Create new dialog</a>文档。</p></p>
<p style="font-size: 20px;">关于ios - Quickblox chatRoomDidReceiveMessage 没有调用,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/34842562/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/34842562/
</a>
</p>
页:
[1]