3
votes

I have developed a chat application for android using ejabberd as XMPP server. I want to send FCM push notification, when user is offline.

Can anyone help me or give an example for this ?

3
Push notifications when user is offline? :O Do you mean actually attempting to send a notification, even if the device is not online?AL.
Yes i want to send push notification when the user is offline or my app in background.Zain Ul Hassan
I'm confuse, how can i connect my ejabberd (XMPP server) with FCM server. please help me to solve this problem as soon as possible.Zain Ul Hassan
@ZainUlHassan you got any solution ?? if yes than please tell me i'm also stuck in this problemVishal Patoliya ツ
I'm trying to solve it by given solution of #Maryna Krasnova . when i solved it then i'll inform you @VishalPatoliyaツZain Ul Hassan

3 Answers

3
votes

You can add apllication to connect to FCM to your ejabberd, and send notification each time message goes to offline storage with this library

2
votes

I got your mail, I am answering here so it can help others. You should look into this erlang library that I wrote.

https://github.com/softwarejoint/fcm-erlang

The read me section has all the details.

So, your app registers its push token on server. Then when there is a particular event on server, server uses that token to send fcm a message. fcm in-turn sends the message to you.

Best Pankaj

1
votes

I faced the same task and finally solved it by writing my own Ejabberd module. I've stumbled over many problems since a lot has changed in later / the latest version(s) of Ejabberd.

Here's my Stackoverflow question where I just added my now working code for the module.

Maybe that help.