通过XMPPFramework为iOS发送消息 [英] Send a message via XMPPFramework for iOS
本文介绍了通过XMPPFramework为iOS发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过XMPPFramework为objc和ios发送消息?
How do I send a message through the XMPPFramework for objc and ios?
现在它真的在欺骗我。
Its really bugging me now. I need to build a custom method with some custom XML and send it to a specific JID.
任何想法?
谢谢。
推荐答案
NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
[body setStringValue:textvalue];
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:[jid full]];
[message addChild:body];
[[self xmppStream] sendElement:message];
请尝试此
这篇关于通过XMPPFramework为iOS发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文