[英]Chat app not working using XMPP protocol - open-fire server
Am using following code to send text to user using XMPP protocol configured with open-fire server.. i sent message to my app using spark IM client here i can receive the message but i cant send the text again in chat. 我正在使用以下代码通过配置有开火服务器的XMPP协议向用户发送文本。.我在这里使用Spark IM客户端向我的应用发送了消息,我可以接收到消息,但无法在聊天中再次发送文本。
NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
[body setStringValue:msgContent];
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:@"nik@182.17.0.162"];
[message addChild:body];
NSLog(@"message: %@", message);
[xmppStream sendElement:message];
this my code and my message structure is: 这是我的代码和消息结构:
<message type="chat" to="nik@182.17.0.162"><body>rtytry</body></message>
my text is not posting to selected user. 我的文字未发布到所选用户。
Any suggestion ?.. am i doing anything wrong here.. 任何建议吗?..我在这里做错什么了..
Thanks 谢谢
If I would guess: The IP in to=
attribute is wrong. 如果我猜:
to=
属性中的IP错误。 There should go the service name, which is often the domain of the xmpp server or in case of openfire: Whatever is configured as xmpp.domain
server property. 应该有服务名称,该名称通常是xmpp服务器的域,或者在
xmpp.domain
情况下:无论配置为xmpp.domain
服务器属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.