Instance Method

application(_:didFailToRegisterForRemoteNotificationsWithError:)

Sent to the delegate when Apple Push Notification service cannot successfully complete the registration process.

Declaration

optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)

Parameters

application

The app object that initiated the remote-notification registration process.

error

An NSError object that encapsulates information why registration did not succeed. The app can choose to display this information to the user.

Discussion

UIKit calls this method if it was unable to register your app with APNs or if your app is not properly configured for remote notifications. During development, make sure your app has the proper entitlements and that its App ID is configured to support push notifications. You might use your implementation of this method to make a note of the failed registration so that you can try again later.

For more information about how to set up and send remote notifications in your app, see Setting Up a Remote Notification Server.

See Also

Handling Remote Notification Registration

func application(UIApplication, didRegisterForRemoteNotificationsWithDeviceToken: Data)

Tells the delegate that the app successfully registered with Apple Push Notification service (APNs).