How to receive offline messages with XMPP in ios - ios

I am working on a chat using XMPP Protocol. Everything is working fine using XMPP. But I'm unable to receive offline messages from agent when user comes to online. As user A is logged out and user B sends messages to user A, and when user A logs into app, it must receive all the messages that were sent by user B during offline session. How can I receive these messages?

With rooms you can do this easily by joining the chat asking history since the time you went offline. For one-to-one chat, you will have to implement per user offline queue at the server end. And notify server once you are online to receive the chats.

Related

Microsoft Graph API Chat Subscription notify nothing recently

I subscribe the chat message about a chat session,and I can see subscription info on "/subscriptions" API,but can't receive any notify on notify URL recently.
Everything was normal before today.Maybe I send message too fast? When it happened,
I can not receive notify any more,what should I do.

Chat implementation using firebase

I have implemented chat application using firebase realtime database and it working fine. I have few more requirements to meet the complete functionality. Below is the requirement
Last entered message with date/time
No. of Unread message
While you are in the chat listing page showing or updating the counter with messages spontaneously when someone is sending you message
Sending push notification when a user send message
Is these possible using the firebase functionalities ?

chat app Firebase Recieving messages

Currently I have an IOS chat app that runs with firebase. The app is working fine and sending and receiving messages when two users are online. I am using real-time database, however when one of the user is offline (i.e application is killed or even the app is running in background) and the other user is sending a message the messages are not received. Is there is a way where can I know the current state of the user and instead of sending the message I send a notification to notify him that there is a new message.

GroupChat Push Notification on XMPP

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.

Check if users are friends before sending push notification in parse.com cloud code

I'm almost ready to release an iOS app on the app store, but I'm having trouble switching from client to cloud code push notifications.
Each user in the app has a "user" object in parse, and they each have a property (array) of friends.
I want users to be able to send each other notifications, but I don't want client push to be enabled for security purposes.
Essentially, when a user sends a message to a friend, I want cloud code to check if the user is on their friend's friends list, and if they are, send the push notification with the message to that friend.

Resources