如何使用quickblox sdk发送简单的文本消息?
我正在使用QBSimpleChat SDK。我想要发送简单的群组信息。请帮忙。这是我的密码。看看我错过了什么。提前谢谢 QBChatMessage*inviteMessage=[QBChatMessage]如何使用quickblox sdk发送简单的文本消息?,sdk,quickblox,Sdk,Quickblox,我正在使用QBSimpleChat SDK。我想要发送简单的群组信息。请帮忙。这是我的密码。看看我错过了什么。提前谢谢 QBChatMessage*inviteMessage=[QBChatMessage] NSMutableDictionary *customParams = [NSMutableDictionary new]; //customParams[@"xmpp_room_jid"] = roomJID; customParams[@"
NSMutableDictionary *customParams = [NSMutableDictionary new];
//customParams[@"xmpp_room_jid"] = roomJID;
customParams[@"name"] = name;
customParams[@"_id"] = senderId1;
customParams[@"save_to_history"] = @YES;
//customParams[@"type"] = 2;
inviteMessage.senderID = senderId;
inviteMessage.dateSent = [NSDate date];
inviteMessage.senderNick = @"me";
inviteMessage.text = text;
customParams[@"occupants_ids"] = [occupides componentsJoinedByString:@","];
NSString *afterSpace= [occupides componentsJoinedByString:@" "];
NSUInteger num = [oneer integerValue];
NSTimeInterval timestamp = (unsigned long)[[NSDate date] timeIntervalSince1970];
customParams[@"date_sent"] = @(timestamp);
// send notification
//
inviteMessage.recipientID = num;
//}
inviteMessage.customParameters = customParams;
[QBRequest createMessage:inviteMessage successBlock:^(QBResponse *response, QBChatMessage *createdMessage) {
NSLog(@"success: %@", createdMessage);
} errorBlock:^(QBResponse *response) {
NSLog(@"ERROR: %@", response.error);
}];
[self.chatSectionManager addMessage:inviteMessage];
[self finishSendingMessageAnimated:YES];
NSLog(@"message for group is = %@",inviteMessage);
您可以使用
QBChatDialog
实例的方法发送消息:
- (void)sendMessage:(QB_NONNULL QBChatMessage *)message completionBlock:(QB_NULLABLE_S QBChatCompletionBlock)completion;
如需更多进一步解释,请遵循