Tells the delegate that the app successfully registered with Apple Push Notification service (APNs).
- watchOS 6.0+
A globally unique token that identifies this device to APNs. Send this token to the server that you use to generate remote notifications. Your server must pass this token unmodified back to APNs when sending notifications to this device.
The length of APNs device tokens can vary. Do not hardcode the token’s size in your app.
WatchKit calls this method after it successfully registers your app with APNs. In your implementation, send the contents of the
device parameter to the server you use to generate remote notifications. Never cache the device token locally on the user’s device. Device tokens can change periodically, so caching the value risks sending an invalid token to your server.
Typically, the system calls this method only after you call your
register method, but WatchKit may call it under other rare circumstances. For example, WatchKit calls the method when the user launches an app after setting up the watch using a different device’s backup. In this case, the app doesn’t know the new device’s token until the user launches it.