---
title: registerForLocalNotifications()
framework: externalaccessory
role: symbol
role_heading: Instance Method
path: externalaccessory/eaaccessorymanager/registerforlocalnotifications()
---

# registerForLocalNotifications()

Begins the delivery of accessory-related notifications to the current application.

## Declaration

```swift
func registerForLocalNotifications()
```

## Discussion

Discussion Call this method to be notified when an accessory becomes connected or disconnected. The system does not send EAAccessoryDidConnectNotification and EAAccessoryDidDisconnectNotification notifications automatically, so calling this method lets the system know that your application wants to receive them. Typically, you would call this method only once early in your application, either before or after configuring your notification observers. When you no longer need to monitor these notifications, you should call the matching unregisterForLocalNotifications() method. You can configure your notification observers either before or after calling this method. Because the shared accessory manager is the only object that sends accessory-related notifications, specifying that object or nil for the notification sender has the same outcome.

## See Also

### Managing Connection Status Changes

- [unregisterForLocalNotifications()](externalaccessory/eaaccessorymanager/unregisterforlocalnotifications().md)
- [EAAccessoryDidConnect](foundation/nsnotification/name-swift.struct/eaaccessorydidconnect.md)
- [EAAccessoryDidDisconnect](foundation/nsnotification/name-swift.struct/eaaccessorydiddisconnect.md)
- [EAAccessoryKey](externalaccessory/eaaccessorykey.md)
- [EAAccessorySelectedKey](externalaccessory/eaaccessoryselectedkey.md)
