ios ios推送通知延迟多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9204767/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How much delay of ios push notification?
提问by realsnake
I want to add a fire alarm function to my app. I think the push notification may be the best choice. But if there is much delay, like over 10 mins, it would be meaningless for fire alarm. So how much delay for push notification, assuming the device is online?
我想在我的应用程序中添加火警功能。我认为推送通知可能是最好的选择。但是如果延迟太多,比如超过10分钟,那么火警就没有意义了。那么,假设设备在线,推送通知的延迟是多少?
回答by danielbeard
Push notifications are unreliable and cannot be guaranteed that they have been delivered. It all depends on the apple APNS server, that said, usually when I send a push notification I get the result in under a few seconds.
推送通知是不可靠的,不能保证它们已经送达。这完全取决于苹果 APNS 服务器,也就是说,通常当我发送推送通知时,我会在几秒钟内得到结果。
More Information:
更多信息:
They are not reliable! There is no guarantee that push notifications will actually be delivered, even if the APNS server accepted them.
他们不可靠!即使 APNS 服务器接受了推送通知,也无法保证实际发送推送通知。
As far as your server is concerned, push notifications are fire-and-forget; there is no way to find out what the status of a notification is after you've sent it to APNS. The delivery time may also vary, from seconds up to half an hour.
就您的服务器而言,推送通知是一劳永逸的;将通知发送到 APNS 后,无法了解通知的状态。交货时间也可能有所不同,从几秒钟到半小时不等。
Also, the user's iPhone may not be able to receive push notifications all the time. They could be on a WiFi network that does not allow connections to be made to APNS because the required ports are blocked. Or the phone could be turned off.
此外,用户的 iPhone 可能无法一直接收推送通知。它们可能位于不允许连接到 APNS 的 WiFi 网络上,因为所需的端口被阻止。或者手机关机了。
APNS will try to deliver the last notification it received for that device when it comes back online, but it will only try for a limited time. Once it times out, the push notification will be lost forever!
APNS 将尝试在该设备重新联机时发送它收到的最后一条通知,但它只会尝试有限的时间。一旦超时,推送通知将永远丢失!
Source: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
来源:http: //www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
回答by Kethu Satya
To avoid the delay,we should take care libraries of FCM in build.gradle(both project and module level ) and google-services.json. All should be up to date.
为了避免延迟,我们应该注意 build.gradle(项目和模块级别)和 google-services.json 中的 FCM 库。一切都应该是最新的。
回答by Brian Trzupek
I just found this while trying to resolve another issue I was having. A viable solution for this problem would be something like PubNub. They offer reliability, performance, and service guarantees
我刚刚在尝试解决我遇到的另一个问题时发现了这一点。这个问题的一个可行的解决方案是像 PubNub 这样的东西。它们提供可靠性、性能和服务保证