开发者

Chat app not working using XMPP protocol - open-fire server

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜