How can we access archived messages in android application from xmpp server

I did a brief overview of the xmpp.org website and read everything related to message archiving (protocol XEP-0136). After reading the entire document, I still don’t get the exact way to start implementing this application in my Android application. Any of us can help me how we can realize access to the archive of messages in the client’s hand. I use the smack library for this in my application.

+6
source share
1 answer

First, make sure your server implements XEP-0136 . Many do not.

Then you will want to create your own subclass of IQ. See OfflineMessageRequest for an example. You need getters and setters for all sub-elements of the archive protocol.

Carefully register the IQ handler with ProviderManager.addIQProvider .

Finally, write a controller class that sends IQ, waits for results, and handles protocol semantics. See the OfflineMessageManager for XEP-0013 for an example that looks like what you want.

+2
source

Source: https://habr.com/ru/post/893594/


All Articles