Register to receive remote notifications from the Apple Push Notification service (APNs).
- watchOS 6.0+
Before calling this method, you must enable your WatchKit extension’s Push Notification capability, as described in Enable push notifications.
Call this method to register a device with APNs. If registration succeeds, the system calls your extension delegate’s
did method and passes it a device token. Pass this token to the provider server you use to generate remote notifications for this device. If registration fails, the system calls your extension delegate’s
did method instead.
To display alerts, play sounds, or perform other user-facing actions, you must also request authorization using the
request method. If you do not request and receive authorization for your app’s interactions, the system delivers all remote notifications to your app silently.
If your watchOS app has an iOS companion, always send notifications to both watchOS and the paired iOS device. As long as the payloads are identical, the system recognizes the duplicates, and only displays one notification to the user.