问题
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
回答1:
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:
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.
来源:https://stackoverflow.com/questions/30253948/how-to-send-push-notification-to-offline-users-of-xmpp