XMPPFramework
XMPPFramework copied to clipboard
mam not sort message from query
let xmppDateString = NSDate().xmppDateTimeString
var fields: [XMLElement] = []
let start = XMPPMessageArchiveManagement.field(withVar: "end", type: nil, andValue: xmppDateString)
fields.append(start)
print(self.mam_info.entityBareId+ServiceName_arroa)
let value = DDXMLElement(name: NTConstants.value, stringValue: self.mam_info.entityBareId+ServiceName_arroa)
let child = DDXMLElement(name: NTConstants.field)
child.addChild(value)
child.addAttribute(withName: NTConstants.varXMPP, stringValue: NTConstants.with)
let set = XMPPResultSet(max: 40, before: "")
xmmpMessageArchiveManagement!.retrieveMessageArchive(at: XMPPJID(string: self.mam_info.entityBareId+ServiceName_arroa), withFields: fields, with: set)
hi
I try to retrieve chat history from XMPP. I am also done this code in my project but its not working.
please clarify this issue.
@Abishekt97 Hi , It worked for me to obtain the historial, I have to review it .. there we could talk about it and help us too
hi @dverdugo85 thanks for your replay
My code
let xmppDateString = NSDate().xmppDateTimeString var fields: [XMLElement] = [] let start = XMPPMessageArchiveManagement.field(withVar: "end", type: nil, andValue: xmppDateString) fields.append(start) let value = DDXMLElement(name: "value", stringValue: user) let child = DDXMLElement(name: "field") child.addChild(value) child.addAttribute(withName: "var", stringValue: "with") let set = XMPPResultSet(max: 20, before: "") fields.append(child) xmppMAM?.retrieveMessageArchive(at: XMPPJID(string: user), withFields: fields, with: set)
But its not working. please visit my stack overflow question and if you know please answer https://stackoverflow.com/questions/64749713/issue-on-retrieve-the-xmpp-archived-message-from-ejabberd-serverchat-history