I am developing, chat application for android and iphone using ejabberd as XMPP server and php. I want to send GCM push notification for android and apple push notification for iphone.,when user is offline. I have successfully installed ejabberd and chat process is working fine. Now the problem is that i want to notify a user in some circumstance. I am unable to decide what should be configured on ejabberd server side and what should be on client side ? Can anyone help me with all process step by step ?
1 Answers
As far as I know, ejd does not have a module that does APNS/GCM pushes automatically. You'd have to develop a module on your own. For good intro to modules in ejd see (http://metajack.im/2008/08/28/writing-ejabberd-modules-presence-storms/). Once you know how to hook your logic to ejd you will be able to start sending notification. Apple's service is TCP based. GCM is REST/Web Service interface. In case of APNS you 'd need notification token from the phone and use that token to send notifications via Apple's service interface (interface is described here https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html). For GCM you will have to do the research (I am not sure exactly how that mechanism works).