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.
what happens behind the scenes of executing `UIApplication.shared.registerForRemoteNotifications()` in iOS?
117 views Asked by Jafar Khoshtabiat At
2
There are 2 answers
4
On
So this all works like this:
1) Your app asks to be registered with APNs.
2) On successful registration, APNs sends an app-specific device token to the device.
3) The system delivers the device to your app by calling a method in your app delegate.
For more information, check these links :- https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html
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.