【发布时间】:2013-11-22 06:34:50
【问题描述】:
我在 ios 中使用 XMPP 框架。如何邀请其他用户进行群聊?
[xmppRoom1 inviteUser:[XMPPJID jidWithString:@"abc@domain.com"] withMessage:@"Come Join me"];
【问题讨论】:
标签: ios iphone objective-c ios6 xmpp
我在 ios 中使用 XMPP 框架。如何邀请其他用户进行群聊?
[xmppRoom1 inviteUser:[XMPPJID jidWithString:@"abc@domain.com"] withMessage:@"Come Join me"];
【问题讨论】:
标签: ios iphone objective-c ios6 xmpp
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"];
}
【讨论】:
此代码对我有用。
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 "];
【讨论】: