【问题标题】:Send a message via XMPPFramework for iOS通过 XMPPFramework for iOS 发送消息
【发布时间】:2011-05-26 12:56:45
【问题描述】:

如何通过 XMPPFramework for objc 和 ios 发送消息?

现在真的很烦我。我需要使用一些自定义 XML 构建自定义方法并将其发送到特定的 JID。

有什么想法吗?

谢谢。

【问题讨论】:

  • 嗨,你能指导我如何添加 XMPPFramework,我用谷歌搜索,但链接给出了 404 错误.. 我下载的一些 XMPPFrameworks 像 iPhoneXMPP 但它给出了错误..请指导我@Thomas Clayson

标签: iphone cocoa-touch xmppframework


【解决方案1】:
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];

试试这个

【讨论】:

  • 请检查这个问题。我按照你的建议做,没有结果:[link]stackoverflow.com/questions/11096649/…
  • 嗨,你能指导我如何添加 XMPPFramework,我用谷歌搜索,但链接给出了 404 错误..我下载的一些 XMPPFrameworks 像 iPhoneXMPP 但它给出了错误..请指导我@harshalb跨度>
  • 像魅力一样工作。非常感谢。
猜你喜欢
  • 2012-06-21
  • 1970-01-01
  • 2012-01-24
  • 2012-10-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多