5
votes

I want to develop a chat application in iphone. I'm using ejabberd xmpp server. Now i'm able to send message to other user.

Now i want to receive the message with push notification.

I heard that we can use xmpp servers to send push notifications.

So Can anyone tell me, I want to know how

  • Is it possible to send push notification with ejabberd

  • Is it possible send push notifications from ejabberd xmpp server using node js.

Please give any suggestion to start using notifications for messages in xmpp.

2
ejabberd business edition have push notifications module. If you want to use community edition, then you need to develop your own extension.vitalyster

2 Answers

4
votes

If you want to send push notifications with ejabberd community edition, you need to add an ejabberd module, which sends the offline messages to a specified push notification provider. This provider send the notifications to apple APNS or googles GCM. You could develop a module by self or maybe you will find some in inet. mod_zeropush (https://github.com/ZeroPush/mod_zeropush) would be one of them, but the zeropush service by self is canceled. Another one would be mod_onesignal (https://github.com/nobreak/mod_onesignal). OneSignal is a free to use Push Notification provider.

0
votes

XMPP requires a persistent socket connection or a "persistent" BOSH connection during your whole XMPP session. Whenever your iOS app goes in background iOS kills your socket connection, and your Openfire server kills your XMPP session. This means the user goes offline. Which is also the reason why incoming messages for this user go to the offline storage.

A more straight forward approach is to do something in openfire, when openfire can't deliver a message it stores it in offline table, we can do some interception on that part and initiate the push process with the message.