1
votes

I am using Openfire for the xmpp server and so far its been great. The problem I am facing now is with push notifications. The app is written in Xcode which gets user data from a PHP Api. Openfire is the xmpp server. The issue is that when the app sends a message to openfire I would need to also query the Php api to see if the user is online and if they are not, send a push notification. This would have to happen for each message sent and as you might guess that will affect performance with all those requests happening.

I have everything working, I just cant get past this hump. If only openfire would fife off a request of my choice upon receiving a message.

Can anyone suggest a better idea? Basically need to know if the user is online (presence) before so that I know to fire off the push notification.

One thing also for sending push notification php script is right or openfire have some plugin.

Thanks.

1
You don't need to anything in php, XMPP supports to check user is online or not.AkshayP
So is it possible to send push notification using xmpp in php because i have deploy this code from webapi which is in phpvarun joshi
No, from xmpp when user's status will be offline then call API to send PushNotificationAkshayP
In php is it possible to use send push notification apivarun joshi
Yes, you have to write web service to send push notification. Then from app side if user found online then call that web service.AkshayP

1 Answers

0
votes

I think using php script to check for offline user is an expensive affair.

I have used ejabberd server. For which you can create custom modules using "offline_message_hook" and using this module you can invoke php script to send push notification.

This hook is called when someone send message to an offline user. Following link might be helpful.

http://jasonrowe.com/2011/12/30/ejabberd-offline-messages/

If you are stuck somewhere, I can help.