powered by Jive Software

Retrieving Offline Messages


I am unable to retrieve offline messages using OfflineMessageManager, however I am able to retrieve the offline messages using PacketListener with PacketTypeFilter(Message.class) as a work around.

Just an info : supportsFlexibleRetrieval() returns true but getMessageCount() returns zero.

Please let me know, the possible reasons for Offline Messages not retrieved through OfflineMessageManager.



I am able to retrieve the Offline Messages using “OfflineMessageManager”. I followed the below mentioned steps.

On creating connection, I set setSendPresence() to false.This prevents login() to send “available” presence packet to server.

connConfig.setSendPresence(false); // where connConfig is object of ConnectionConfiguration.
XMPPConnection conn = new XMPPConnection(connConfig);
// connect to XMPP Server then login.
// Now retrieve the offline msgs using “OfflineMessageManager”
// send presence packet to server.

Hope, this helps.


Marking question as answered.