Reputation: 13
I am using XMPP Framework in ios. How can i invite other users for Group Chat?
[xmppRoom1 inviteUser:[XMPPJID jidWithString:@"[email protected]"] withMessage:@"Come Join me"];
Upvotes: 0
Views: 589
Reputation: 467
This code works for me.
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomMemoryStorage jid:[XMPPJID jidWithString:@"Groupname"] dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:xmppStream];
[xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRoom inviteUser:[XMPPJID jidWithString:@""] withMessage:[NSString stringWithFormat:@"Come Join me"] listusers:@" array with list of users JID "];
Upvotes: 0
Reputation: 350
You can invite multiple users one by one in MUC:
for (int contactIndex = 0; contactIndex <contactsToInviteArray.count; contactIndex++)
{
NSString * inviteUserJID = [NSString stringWithFormat:@"%@@%@",[contactsToInviteArray enter code hereobjectAtIndex:contactIndex], SERVER_NAME];
[xmppRoom1 inviteUser:[XMPPJID jidWithString:inviteUserJID] withMessage:@"Come Join me"];
}
Upvotes: 1