Am using following code to send text to开发者_Python百科 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.
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. 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.
精彩评论