XMPP ejabberd SaaS的推送通知 [英] XMPP ejabberd SaaS Push Notifications

查看:429
本文介绍了XMPP ejabberd SaaS的推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个更新到我的previous问题,<一个href=\"http://stackoverflow.com/questions/35035406/xmpp-push-notifications-causing-problems-delay-duplications-in-messages/35036081?noredirect=1#comment57832535_35036081\">XMPP推送通知造成的问题的。

This is an update to my previous question, XMPP push notifications causing problems.

感谢来自的MickaëlREMOND延迟和重复问题的答案都走了,但我还是不明白推送通知的行为。

Thanks to the answer from Mickaël Rémond delay and duplication issues are gone but I still fail to understand the behaviour of push notifications.


  1. 如果我移动应用的背景(无锁定装置或终止),它不会接受任何推送通知,当我把它带回前景所有的消息都非常欢迎。

  1. If I move the app to background (without locking device or termination) it won't receive any push notifications, and when I bring it back to foreground all the messages are received perfectly.

当应用程序在前台,我锁定设备,没有通知触发,但消息被完全接收。

When the app is in foreground and I lock the device, no notifications are triggered but messages are received perfectly.

当应用程序在后台,我锁定装置,通知被触发,消息被完全接受,但有时的消息发送后收到 sendLastActivityQueryToJID

When the app is in background and I lock the device, notifications are triggered, messages are received perfectly but sometimes messages are received after sending sendLastActivityQueryToJID.

我不知道是怎么回事,但如果你们有什么想法,请让我知道。结果
PS我已删除背景模式形成我的应用程序。

I don't know what's going on here but if you guys have any idea please let me know.
PS i have removed Background modes form my app.

推荐答案

这似乎并未有任何与ejabberd,但似乎与推送通知如何适用于iOS。

It does not seem to have anything to do with ejabberd but seems related to how push notification works on iOS.

我不完全知道你正在尝试做的,但你不应该删除背景模式为您的应用程序。有没有必要并且有许多其他益处可让应用程序很短,而在后台模式下运行,做适当的内部管理任务。

I am not totally sure what you are trying to do but you should not remove background mode for your app. There is no need to and there is many other benefit in allowing the app to run for a short while in background mode, to do proper house keeping tasks.


  1. 应用程序在后台一般三分钟被杀害之前运行。在您收到应用程序内的正常XMPP消息,那个时候它的意思。你必须触发在那个状态和在接收到XMPP消息APPM本地通知。

  1. App in background usually run for three minutes before being killed. It means during that time you receive normal XMPP message inside the app. You have to trigger local notification from the appm in that state and upon receiving an XMPP message.

当应用程序在前台,iOS设备将永远不会显示任何通知。这是预期的。如果您在XMPP服务器连接时,您将收到XMPP消息。如果没有连接,您将收到通知,但他们不会被显示出来。它是由你做他们的东西在你的应用程序。

When app is in foreground, iOS will never display any notification. This is expected. If you are connected on the XMPP server, you will receive XMPP message. If not connected, you will receive notification, but they will not be displayed. It is up to you to do something with them in your app.

您在你的问题有些困惑:如果您的应用程序是在后台,通知是触发,但消息不应该只有当您重新打开/重新连接到会话或重新连接同一时间收到。
如果你需要一些交通接收消息,那是因为你没有做空白存留。如果你不这样做,服务器会认为你突然失去了联系,并开始发送推送通知和缓冲消息。确保你实施的空白保持活跃在文档中推荐否则就不能正常工作。

You have some confusion in your question: If you app is in background, notifications are trigger, but message should not be receive at the same time only when you reopen / reattach to session or reconnect. If you need some traffic to receive messages, it is because you are not doing whitespace keep alive. If you do not do that, the server will think you suddenly lost the connection and will start sending push notification and buffering messages. Make sure you implement whitespace keep-alive as recommended in the document as otherwise it cannot work fine.

这篇关于XMPP ejabberd SaaS的推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆