How to get latest 10 messages(Items) from pubsub node?

34 views
Skip to first unread message

Baban Jadhav

unread,
Feb 7, 2018, 11:11:37 AM2/7/18
to XMPPFramework
Hi,

     I have create chat app using XMPPFRAMEWORK.  I have created pubsub node. I want get 10 latest chatting message from this pubsub node. how to implement this in iOS??


Regards,
Baban Jadhav.

Baban Jadhav

unread,
Feb 8, 2018, 1:43:15 AM2/8/18
to XMPPFramework

I have tried below code. But it gives all messages(Items) from pubsub node

  let host = "YOUR_HOST_NAME"

  let serviceJID = XMPPJID(string: "pubsub.\(host)"

  let xmppPubSub = XMPPPubSub(serviceJID: serviceJID, dispatchQueue: DispatchQueue.main)

  xmppPubSub.addDelegate(self, delegateQueue: DispatchQueue.main)

  xmppPubSub.activate(appDelegate.xmppController.xmppStream)

  xmppPubSub.retrieveItems(fromNode: "YOUR_NODE_NAME")


But, I want to get latest 10 message(Items) from pubsub node.
Reply all
Reply to author
Forward
0 new messages