Offline Message


could you help me with OfflineMessageManager, how to use it?

some example code would be very useful…

Do I have to send messages in some specific way or normaly?

Will it work with multiUserChat ?


Hi Selene,

  • In this class there are some good examples: org.jivesoftware.smackx.OfflineMessageManagerTest

For example in the method: testReadAndDelete you have something like this:

OfflineMessageManager offlineManager = new OfflineMessageManager(getConnection(1));

offlineManager.getMessageCount()); // the number of offline messages

Iterator messages = offlineManager.getMessages(stamps); // Get the offline messages {@see Message}[/i]

  • Clients send messages in the same way:

Chat chat = getConnection(0).createChat(getBareJID(1));

chat.sendMessage(“Test 1”);

chat.sendMessage(“Test 2”);[/i]

I hope it is clear enough, let me know if you have further questions.