MUC message archive?

@Flow I am working on an Android and iOS app, I am using XMPP protocol and Open Fire for Peer to Peer chat and its working fine.

But now I am working on Group Chat, and stuck at Offline Message section.

  1. I need to understand how to figure out which user in the group is offline?
  2. How to target offline users and send them the notification of the message?
  3. How to get the total unread messages if the user is offline?
  4. How to get the history of the Group if the user comes online after a long time?

Let me know how to resolve this.
or else let me know if you need any more information.

This feels like a duplicate of: Unable to get Offline Messages in Group Chat