【发布时间】:2014-02-10 22:08:50
【问题描述】:
在我的应用程序中,我的 User to User 单一聊天运行良好。
但是如果我向任何用户发送 Room 邀请,那么单次聊天将无法正常工作。
我还没有在应用中附加群聊代码。只需将 Room 邀请发送给其他用户,然后创建单个聊天。
有什么我错过的逻辑吗?
我的创建和邀请代码
XMPPRoomMemoryStorage * _roomMemory = [[XMPPRoomMemoryStorage alloc]init];
NSString* roomID = [NSString stringWithFormat:@"%@@conference.room",strGlobalRoomNameForLogin];
XMPPJID * roomJID = [XMPPJID jidWithString:roomID];
xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:_roomMemory jid:roomJID dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:xmppStream];
[xmppRoom joinRoomUsingNickname:[NSString stringWithFormat:@"%@",strCureentUserName] history:nil];
//NSLog(@"strCureentUserName %@",strCureentUserName);
//.........inviting the Friend.......
for (int i=0; i<[arrUserName count];i++) {
NSString *strInviteUserEmalid = [[arrUserName objectAtIndex:i] stringByReplacingOccurrencesOfString:@"@" withString:@"$"];
// NSLog(@"strInviteUserEmalid %@",strInviteUserEmalid);
[xmppRoom inviteUser:[XMPPJID jidWithString:[NSString stringWithFormat:@"%@@user",strInviteUserEmalid]] withMessage:@"Come Join me in this room"];
}
[xmppRoom fetchConfigurationForm];
[xmppRoom configureRoomUsingOptions:nil];
[xmppRoom addDelegate:_roomMemory delegateQueue:dispatch_get_main_queue()];
【问题讨论】:
标签: ios iphone objective-c xmpp openfire