1
votes

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.

NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
    [body setStringValue:msgContent];

    NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
    [message addAttributeWithName:@"type" stringValue:@"chat"];
    [message addAttributeWithName:@"to" stringValue:@"[email protected]"];
    [message addChild:body];
    NSLog(@"message: %@", message);
    [xmppStream sendElement:message];

this my code and my message structure is:

<message type="chat" to="[email protected]"><body>rtytry</body></message>

my text is not posting to selected user.

Any suggestion ?.. am i doing anything wrong here..

Thanks

1

1 Answers

0
votes

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.