iosswiftapple-push-notificationsdevicetoken

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


I'm wondering what's happening behind the scenes when registering ios applications for push notifications and how the ios device receives device-token in application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) callback. I need to know the complete scenario and protocol communication.


Solution

  • the most related things I could find are:

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

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

    what I could understand is that most of the work is done by os that establishes a direct and persistent connection to apple's servers. no more information about any protocols or request-responses.