<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplication/registerForRemoteNotifications(matching:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSApplication(im)registerForRemoteNotificationTypes:"
  },
  "title" : "registerForRemoteNotifications(matching:)"
}
-->

# registerForRemoteNotifications(matching:)

Register to receive notifications of the specified types from a provider through the Apple Push Notification service.

```
func registerForRemoteNotifications(matching types: NSApplication.RemoteNotificationType)
```

## Parameters

`types`

A bit mask specifying the types of notifications the app accepts. See [`NSApplication.RemoteNotificationType`](/documentation/AppKit/NSApplication/RemoteNotificationType) for valid bit-mask values.

## Discussion> Deprecated: Use ``doc://com.apple.appkit/documentation/AppKit/NSApplication/registerForRemoteNotifications()`` instead.

When you send this message, the device initiates the registration process with Apple Push Notification Service. If it succeeds, the app delegate receives a device token in the [`application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`](/documentation/AppKit/NSApplicationDelegate/application(_:didRegisterForRemoteNotificationsWithDeviceToken:)) method; if registration doesn’t succeed, the delegate is informed via the [`application(_:didFailToRegisterForRemoteNotificationsWithError:)`](/documentation/AppKit/NSApplicationDelegate/application(_:didFailToRegisterForRemoteNotificationsWithError:)) method. If the app delegate receives a device token, it should connect with its provider and pass it the token.

> Note:
> Currently the only notification type supported in macOS for non-running apps is icon badging. However, the JSON payload, which may contain information related to sounds and alerts, is passed to a running app in ``doc://com.apple.appkit/documentation/AppKit/NSApplicationDelegate/application(_:didReceiveRemoteNotification:)``. The app can do whatever it wants to with that information (for example, display an alert or play a sound).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)