Enable "confirm message delivery" from the ejabberd server configuration and needful changes required in the mobile app (Flutter) for sending ACK back to the server. so that if message loss happens ejabberd by itself retransmit it.
Problem statement:
1. Internet disconnected
2. App uninstalled
3. Mobile battery dies
The Ejabberd server assumes the device is online on the above conditions, for this, I have enabled the mod_ping also but it is taking a minimum of 30 seconds to identify the device is offline, so the messages sent within this 30 seconds frame are lost because according to ejabberd device is online so messages are not getting stored in offline queue.
The budget will be $30 - $70.
Duration of 1 - 2 days.