【问题标题】:Single chat and group chat at same time in xmppxmpp中同时单聊和群聊
【发布时间】: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


    【解决方案1】:

    对于大量受邀者,您的服务器可能会遇到“业力”限制。尝试通过添加超时来更慢地发送邀请。

    【讨论】:

      猜你喜欢
      • 2017-07-13
      • 2016-02-29
      • 1970-01-01
      • 2012-05-30
      • 1970-01-01
      • 2015-01-15
      • 2016-01-26
      • 2011-02-19
      • 2017-03-24
      相关资源
      最近更新 更多