robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

unable to retrieve the one to one chat history? #1193

Open Abishekt417 opened 4 years ago

Abishekt417 commented 4 years ago
func getArchieveMessages(forUser user:String){
        var fields = [DDXMLElement]()
        fields.append(XMPPMessageArchiveManagement.field(withVar: "start", type: "text-single", andValue: Date().addingTimeInterval(-(2*24*60*60)).toString(format: .messageRTetriveFormat)))
        xmppMAM.resultAutomaticPagingPageSize = 150
        xmppMAM.retrieveMessageArchive(at: XMPPJID(string: user), withFields: fields, with: nil)
        //  xmppMAM.retrieveMessageArchive(at: nil, withFields: [child], with: set)
    }

I write code like this for retrieve history. After call this method

we received call back on delegate

func xmppMessageArchiveManagement(_ xmppMessageArchiveManagement: XMPPMessageArchiveManagement, didFinishReceivingMessagesWith resultSet: XMPPResultSet) {
        print("didFinishReceivingMessagesWith", resultSet)
    }