powered by Jive Software

Retreive a count of a unread messages from an JabberID


I am developing chat mobile application using openfire with XMPPFramework in iOS.

I have a request to make bubble that will need to stay next to the nickname of user in roster list (UITableView) that need to display

a count of unread messages that this user have.

I am wondering if there is an way to get that information from OpenFire server and how?

Openfire supports XEP-0013: Flexible Offline Message Retrieval

You would have to check how to do it with you iOS framework.

I think what he needs is not his own messages. As i understood he needs to see unread counts for his contacts in the roster. And not just unread messages from him to these contacts, but the count of unread messages they have in total with all their contacts. Also unread doesn’t necessary mean offline. Probably he needs to show a count of unread messages even if the user is online and actually received them, but didn’t open the chat window to read them Not sure if this is possible at all (getting such information about the other user especially and also somehow monitoring if a user has read the message).


@wroot Yes, like that!

actually my workflow is next:

  1. User login in application with his credentials which are associated with openfire server

  2. In application user tap on “Messages” button like on facebook and on next screen he can see all chat conversations that he made with other users of application

  3. In that “Conversations” screen I want to display in every conversation information also how much unread messages are in that conversation in bubble on right corner.

I will try to figure out somehow how to do this… also here is a new idea for new openfire plugin with REST API

Ok, in this case, I think, you need to write your own Openfire plugin and either use REST api to query the unread messages of your contacts or use a custom XMPP extension protocol (some IQ-get).

Unread is also different to undelivered. If you just ask the OfflineStorage for undelivered messages, it would be the easiest. Displaying delivered, but unread messages is hard to do. It would involve some protocol for the receiving client, too.

1 Like