【发布时间】:2018-07-14 06:10:09
【问题描述】:
我想检索我在 XMPP 中发送给某人的最后一条消息。
我已经编写了这段代码,但它会获取所有发送的消息:
let query = try? XMLElement(xmlString: "<query xmlns='urn:xmpp:mam:2'/>")
let iq = XMLElement.element(withName: "iq") as? XMLElement
iq?.addAttribute(withName: "type", stringValue: "set")
iq?.addAttribute(withName: "from", stringValue: "f.talebi@x.ir")
iq?.addAttribute(withName: "max", stringValue: "1")
iq?.addAttribute(withName: "id", stringValue: "GetLastUserMessage")
if let aQuery = query {
iq?.addChild(aQuery)
}
xmppStream.send(iq!)
【问题讨论】:
标签: ios swift xmppframework