We are developing an xmpp application on IOS and Android. We are using ejabberd as the xmpp server and we are also using mod_interact (https://github.com/adamvduke/mod_interact) to inform our webservers to send push notifications to clients for their offline messages:
Flow is like this:
- Sender sends the message to ejabberd
- Ejabberd receives the message and check if the receipant is online
- If the receipant is offline ejabberd saves the offline message
- mod_interact works when an offline message received by ejabberd and deliver the message to our webservers
- Web server finds the push notification informations about clients and sends the push notification
Its working very well on 1 to 1 chat. But in group chat(MUC) mod_interact doesnt work and I cannot send push notification to group receipants. Do you know any other solutions to fix that problem on both 1 to 1 and group chat.
Thanks
Look into ejabberd_mod_offline_post, it supports both one2one and MUC.
- First config the Room must be a Member-Only room, and add all users as members right after you created it, so that be able to get a total.
- Add above model into ejabberd models.
- Implement a Callback Service to handle the callback post.
The idea is when User go offline:
- In one-to-one case, offline_message_hook will be raised
- In MUC case, muc_filter_message will be raised, and any one not Presence-Available is offline.