---
title: "application(_:didFailToRegisterForRemoteNotificationsWithError:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplicationdelegate/application(_:didfailtoregisterforremotenotificationswitherror:)"
---

# application(_:didFailToRegisterForRemoteNotificationsWithError:)

Tells the delegate that the app was unable to register for Apple Push Services.

## Declaration

```swift
@MainActor optional func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: any Error)
```

## Parameters

- `application`: The application that initiated the remote-notification registration process.
- `error`: An NSError object that encapsulates information why registration did not succeed. The application can display this information to the user.

## Discussion

Discussion The delegate receives this message after the registerForRemoteNotifications(matching:) method of NSApplication is invoked and there is an error in the registration process. For more information about how to register with APNs, see Registering your app with APNs.

## See Also

### Handling Push Notifications

- [application(_:didRegisterForRemoteNotificationsWithDeviceToken:)](appkit/nsapplicationdelegate/application(_:didregisterforremotenotificationswithdevicetoken:).md)
- [application(_:didReceiveRemoteNotification:)](appkit/nsapplicationdelegate/application(_:didreceiveremotenotification:).md)
