can't receive group message using xmpp
I can't receive group message on this method.
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
{
NSLog(@"Message received description === %@",[message description]);
}
-(void)sendGroupMessage:(NSString *)NameOfGroup :(NSString *)Msg
{
[xmppRoom sendMessageWithBody:Msg];
NSXMLElement *x = [NSXMLElement elementWithName:NameOfGroup xmlns:XMPPMUCNamespace];
XMPPMessage *message = [XMPPMessage message];
[message addAttributeWithName:@"to" stringValue:[NSString stringWithFormat:@"%@",NameOfGroup]];
[message addChild:x];
NSLog(@"x in Invite === %@",x);
[xmppRoom sendMessage:message];
}
-(void)setUpRoom:(NSString *)ChatRoomJID
{
NSString *Strng=[NSString stringWithFormat:@"Abc@conference.localhost"];
ChatRoomJID=Strng;
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPJID *roomJID = [XMPPJID jidWithString:ChatRoomJID];
xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomMemoryStorage jid:roomJID dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:xmppStream];
[xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRoom joinRoomUsingNickname:self.UserID
history:nil
password:nil];
[self performSelector:@selector(ConfigureNewRoom:) withObject:nil afterDelay:4];
}
First of all I create new group, send invitation and successfully accept it also for all invited users. When I send message on that group, all person got message successfully, But if I will stop App and run again and login with xmpp and send message on group, message is not delivered to joined users.
When i have to log out and login again to xmpp server and send message on previously created group i got this error message
<message xmlns="jabber:client" from="dharmraj123@conference.localhost" to="revoz1wwbzji1e1481005747@localhost/1824017799289652742921131" type="error"><body>1 Message</body><error code="406" type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></not-acceptable><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Only occupants are allowed to send messages to the conference</text></error></message>
链接地址: http://www.djcxy.com/p/93532.html
上一篇: Amazon S3桶策略未保存
下一篇: 无法使用xmpp接收群组消息