失去互联网连接后推送通知会发生什么?

发布于 2024-12-29 05:37:34 字数 118 浏览 3 评论 0原文

如果应用程序正在等待推送通知并且互联网连接不可用,会发生什么情况?

例如,我告诉我的服务器执行任务“A”,并在任务准备就绪时通过 APNS 通知我。但是,在我将任务发送到服务器后,应用程序失去了互联网连接。

What happens if an application is waiting for a push notification and the internet connection is unavailable?

For example, I tell my server to do task "A", and notify me via APNS when the task is ready. But, after I send the task to the server, the application loses internet connectivity.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心凉 2025-01-05 05:37:34

当 iPhone 上的互联网连接再次可用时,将会发送通知。

Apple 推送通知服务包含默认服务质量
执行存储转发功能的 (QoS) 组件。如果 APN
尝试发送通知但设备离线,QoS
存储通知。每个通知仅保留一个通知
设备上的应用程序:从设备收到的最后通知
该应用程序的提供者。当设备离线后
重新连接时,QoS 将存储的通知转发到设备。
QoS 在删除之前保留通知一段有限的时间
它。

请参阅本地和推送通知编程指南<的“服务质量”部分/a>.

Notification will be delivered when internet connection on iPhone becomes available again.

Apple Push Notification Service includes a default Quality of Service
(QoS) component that performs a store-and-forward function. If APNs
attempts to deliver a notification but the device is offline, the QoS
stores the notification. It retains only one notification per
application on a device: the last notification received from a
provider for that application. When the offline device later
reconnects, the QoS forwards the stored notification to the device.
The QoS retains a notification for a limited period before deleting
it.

See "Quality of Service" section of Local and Push Notification Programming Guide.

半窗疏影 2025-01-05 05:37:34

使用自己的服务器 API 发送 PUSH 时要小心,并考虑 APNs 提供商 API 负载中的 apns-expiration 字段。

此标头标识通知不再有效且可以丢弃的日期...

...如果值为 0,APN 会将通知视为过期
立即并且不存储通知或尝试
重新发送...


苹果

这可能是网络连接恢复后没有推送通知的原因。

Be careful when sending PUSHes with own server API, and also take into account apns-expiration field in APNs Provider API payload.

This header identifies the date when the notification is no longer valid and can be discarded...

...if the value is 0, APNs treats the notification as if it expires
immediately and does not store
the notification or attempt to
redeliver it...

By Apple.

It can be the reason, that the push notification does not come after network connection was restored.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文