在 iOS 中执行 `UIApplication.shared.registerForRemoteNotifications()` 的幕后发生了什么?

what happens behind the scenes of executing `UIApplication.shared.registerForRemoteNotifications()` in iOS?

我想知道在为推送通知注册 ios 应用程序时幕后发生了什么,以及 ios 设备如何在 application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) 回调中接收设备令牌。我需要知道完整的场景和协议通信。

所以这一切都是这样的:

1) 您的应用要求注册 APNs。

2) 成功注册后,APNs 会向设备发送特定于应用程序的设备令牌。

3) 系统通过调用应用委托中的方法将设备交付给您的应用。

有关更多信息,请查看这些链接:- https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html

https://nshipster.com/apns-device-tokens/

我能找到的 most 相关的东西是:

https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html

https://developer.apple.com/library/archive/technotes/tn2265/_index.html

我能理解的是,most 的工作是由 os 完成的,它与苹果的服务器建立了直接和持久的连接。没有关于任何协议或请求响应的更多信息。