ios推送通知有多少延迟? [英] How much delay of ios push notification?

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

问题描述

我想在我的应用中添加火警功能。我认为推送通知可能是最好的选择。但如果有很多延迟,比如超过10分钟,那对火灾报警来说就毫无意义了。
假设设备在线,推送通知有多少延迟?

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?

推荐答案

推送通知不可靠,不能保证他们已经交付。这一切都取决于苹果APNS服务器,也就是说,通常当我发送推送通知时,我会在几秒钟内得到结果

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服务器接受推送通知,也无法保证实际发送推送通知。

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.

此外,用户的iPhone可能无法一直接收推送通知。它们可能位于WiFi网络上,因为所需的端口被阻止,因此无法与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.

APNS将尝试提供该设备重新上线时收到的最后通知,但它只会尝试限制时间。一旦超时,推送通知将永远丢失!

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!

来源: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12

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

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