0
votes

I have been using iOS client https://github.com/robbiehanson/XMPPFramework
successfully install ejabberd on client side and enable the archive mode on server, able to send and receive message.

My problem is how to get older messages and sync to my local core-data. I have read the framework support and it partially support XEP-0136.

I will able to make any custom APIs from server to fetch the messages and sync on the local. But i did not get any common message id or so on that basis i will sync.

If anyone has idea about syncing. please let me know.

2

2 Answers

0
votes

hi i have done many thing in xmpp from (http://xmpp.org/xmpp-protocols/xmpp-extensions/) tutorial you can get example from bellow github links you can get many help from that

(demo links: ) https://github.com/sesharim/ios-jabber-client

https://github.com/funkyboy/Building-a-Jabber-client-for-iOS

(xmmp Project demo Link:)

https://github.com/chrisballinger/ChatSecure-iOS

i hope it will help full you..

you can get how to fetch old messages and user list and other detail from that above demo programs.

0
votes

Read XEP-0136 carefully - it describes how to retrieve existing archive. In fact, XMPPFramework already implement storing all plain incoming messages - you just need to initialize XMPPMessageArchiving with XMPPMessageArchivingCoreDataStorage and activate module on your XMPPStream. Then you may perform core data fetch requests on [XMPPMessageArchiving mainThreadManagedObjectContext]. If you want to retrieve previously archived messages - you should extend XMPPFramework a bit:

  • send <list ... /> query, optionally limited with Result Set Management parameters (which is supported by XMPPFramework too)
  • process result (which gives you archived collections by user jid and timestamp) and ask for interested collection with <retrieve ... /> query
  • process result and send [XMPPMessageArchiving archiveMessage:] with each message in result set, and XMPPFramework will do the rest job - inserts in core data storage - for you.