ios推送通知有多少延迟?

时间:2021-09-16 20:39:26

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分钟,那对火灾报警来说就毫无意义了。假设设备在线,推送通知有多少延迟?

3 个解决方案

#1


36  

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

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

#2


0  

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库。一切都应该是最新的。

#3


-3  

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。它们提供可靠性,性能和服务保证

#1


36  

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

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

#2


0  

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库。一切都应该是最新的。

#3


-3  

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。它们提供可靠性,性能和服务保证