Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
XMPPFramework:仅允许占用者向会议xmpp ios发送消息_Ios_Iphone_Xmpp - Fatal编程技术网

XMPPFramework:仅允许占用者向会议xmpp ios发送消息

XMPPFramework:仅允许占用者向会议xmpp ios发送消息,ios,iphone,xmpp,Ios,Iphone,Xmpp,为什么在尝试在xmpp muc中创建的组中发送消息时出现此错误 这是我收到的信息包 <message xmlns="jabber:client" from="testgrp@conference.localhost" to="7023651847@localhost/787052459360862999820058" type="error"><body>hiiii</body><error code="406" type="modify"><

为什么在尝试在xmpp muc中创建的组中发送消息时出现此错误

这是我收到的信息包

<message xmlns="jabber:client" from="testgrp@conference.localhost" to="7023651847@localhost/787052459360862999820058" type="error"><body>hiiii</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>
hiiiIlony用户可以向会议发送消息
错误文本:仅允许占用者向会议发送消息


我用于创建组的方法是:

错误消息似乎不言自明:您不是占用者(定义见XEP-0045=您未加入房间),因此无法发送消息

您可以在XEP-0045中检查角色权限以供参考:


只有参与者才能向所有人发送消息。

你说得对,但当我第一次加入聊天室并聊天时,在关闭客户端ios应用程序并重新启动应用程序后,这种情况不会发生。如果我发送消息,则会显示此错误。这才是真正的问题当你加入时,你是一个居住者。当您关闭应用程序时,客户端将脱机发送状态信息,包括发送到MUC,并且您不再是用户。这意味着,若你们想再次成为一名居住者并被允许发送消息,你们需要在登录时再次加入。这种行为在XEP-0045中有很好的定义。@MickaëlRémond您能检查代码是否有任何错误吗?让roomStorage=XMPPRoomCoreDataStorage.sharedInstance()让roomJid=XMPPJID.init(字符串:“(groupName)@conference.(constantVar.hostUrl)”)让xmppRoom=xmppRoom.init(roomStorage:roomStorage,jid:roomJid,dispatchQueue:dispatchQueue.main)作为xmppRoom xmppRoom.activate(self.xmppStream)xmppRoom.addDelegate(self,delegateQueue:DispatchQueue.main)xmppRoom.join(使用昵称:self.xmppStream.myJID.bare(),历史记录:nil,密码:nil)