0
votes

we are working on an real time ios and android application for that we are using xmpp protocol and openfire server but now we are facing a problem that when a user is offline he will not get message but we have to send them a push notification like watsapp but we dint get any option in openfire to do it

after some research i got xep-0085 and got to know that it can send push notification if user is offline

but it dint get from where i have to upload apple certificate to send push notification can it send push notification without certificate ?

any help will be appreciated

2
by offline do you mean device without internet?? or the app is not running?abhishekkharwar
@abhishekkharwar app is not runningRahul Kumawat
You may try GCM for Android, and APNS for iOSjmm
@jmm tnx for your reply but we know how to send push notification throught apns and gcm but we dint know how to integrated it with xmpp and send it to offline usersRahul Kumawat

2 Answers

2
votes

It would be easier to use Parse or something similar for push notifications, you can use it for both android and ios.

another option is to expand your systems functionality a little bit, and add a web service that correlates to the application and sends the pushes, that can give you some more control over syncing.

2
votes

You can check receiver is offline or not using below method.

- (void)xmppRoom:(XMPPRoom *)sender didFetchModeratorsList:(NSArray *)items

If your friend is offline than you have to upload message/image to particular server using web service. when your friend will become online than after success connect to xmpp stream he has to call web services for get offline messages. Using this you can easily manage offline messages. I had done this and works fine for me. Let me know if any help.