使用 Django 发送 iOS 推送通知:HTTP/2-based APNs 提供程序 API 和二进制协议

Sending iOS Push Notifications using Django: HTTP/2-based APNs provider API and binary protocol

我们需要使用基于 Django 的后端发送 iOS 推送通知。目前,我们使用这个库 https://github.com/jazzband/django-push-notifications 来发送通知。最近,收到了苹果开发者发来的这封邮件。

The HTTP/2‑based Apple Push Notification service (APNs) provider API lets you take advantage of great features, such as authentication with a JSON Web Token, improved error messaging, and per‑notification feedback. If you still send push notifications with the legacy binary protocol, make sure to upgrade to the APNs provider API as soon as possible. APNs will no longer support the legacy binary protocol after March 31, 2021.

我看到该库使用 apns2 (https://pypi.org/project/apns2/) 在 iOS 上发送推送通知,并使用 HTTP/2 协议发送通知。 那么,这个库可以继续用于发送 iOS 通知,对吗? 谁能为我澄清一下?此外,如果有人可以解释遗留二进制协议的含义,那就太好了。

在此处发布问题后,我还在 Django-Push-Notifications Repository 上提出了 Github 问题。

我已收到维护者的回复,看起来我们可以继续使用这个库。在这里发布他的回复,

For what I understand this should not be an issue nor for this package nor for apns2 (which is used to send Apple-Push-Notifications).

Apple is dismantling the legacy binary protocol (which was announced on October 9 2020) in favor of the HTTP one. However since apns2 implements the latter this would not be an issue here since it already uses the preferred protocol.

For the record: here is the specification of the legacy binary protocol for APNS.

https://github.com/jazzband/django-push-notifications/issues/601#issuecomment-793489138