0
私はQBSimpleChat SDKを使用しています。私は単純なグループメッセージを送るために杖をかける。助けてください。ここに私のコードです。私が逃しているものを見てください。前もって感謝します。quickblox sdkを使って簡単なテキストメッセージを送信するには?
QBChatMessage * inviteMessage = [QBChatMessage message];
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);