简体   繁体   English

如何向xmpp的脱机用户发送推送通知

[英]how to send push notification to offline users of xmpp

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 我们正在为一个实时ios和android应用程序工作,我们正在使用xmpp协议和openfire服务器,但是现在我们面临的问题是,当用户离线时,他不会收到消息,但我们必须向他们发送诸如watsapp的推送通知但是我们确实在openfire中有任何选择

after some research i got xep-0085 and got to know that it can send push notification if user is offline 经过一番研究,我得到了xep-0085,并且知道如果用户离线,它可以发送推送通知

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 任何帮助将不胜感激

It would be easier to use Parse or something similar for push notifications, you can use it for both android and ios. 使用Parse或类似的东西进行推送通知会更容易,您可以将其用于android和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. 另一个选择是稍微扩展您的系统功能,并添加一个与应用程序相关联并发送推送的Web服务,从而使您可以更好地控制同步。

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. 如果您的朋友离线,则必须使用Web服务将消息/图像上传到特定服务器。 when your friend will become online than after success connect to xmpp stream he has to call web services for get offline messages. 当您的朋友上线时(成功连接到xmpp流之后),他必须呼叫Web服务以获取脱机消息。 Using this you can easily manage offline messages. 使用此功能,您可以轻松管理离线消息。 I had done this and works fine for me. 我做到了,对我来说很好。 Let me know if any help. 让我知道是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM