PKPushRegistry
An object that requests the delivery and handles the receipt of PushKit notifications.
Declaration
class PKPushRegistryMentioned in
Overview
A PKPushRegistry object manages only certain types of notifications, such as high-priority notifications needed by a VoIP app. PushKit wakes up your app as needed to deliver incoming notifications and delivers the notifications directly to the push registry object that requested them.
Every time your app launches, whether in the foreground or in the background, create a push registry object and configure it. Typically, you keep the push registry object running for the duration of your app. Each push registry object delivers incoming notifications to its delegate object, which also handles the responses for registration requests. Listing 1 shows how to create a push registry object and request VoIP notifications. Always assign an appropriate delegate object before modifying the desiredPushTypes property.
Listing 1. Creating and configuring a push registry object
Assigning a new value to the desiredPushTypes property registers the push registry object with the PushKit servers. The server reports the success or failure of your registration attempts asynchronously to the push registry, which then reports those results to its delegate object. The push registry also delivers all received notifications to the delegate object. For more information about the delegate methods, see PKPushRegistryDelegate.