---
title: "enableNotification(_:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmcharacteristic/enablenotification(_:completionhandler:)"
---

# enableNotification(_:completionHandler:)

Enables or disables notifications for changes in the value of the characteristic.

## Declaration

```swift
func enableNotification(_ enable: Bool, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func enableNotification(_ enable: Bool) async throws
```

## Parameters

- `enable`: doc://com.apple.documentation/documentation/Swift/true to enable notifications, doc://com.apple.documentation/documentation/Swift/false to disable notifications.
- `completion`: The block executed after the request is processed.

## Discussion

Discussion HomeKit delivers notifications to the accessory delegate using the accessory(_:service:didUpdateValueFor:) method.

## See Also

### Receiving change notifications

- [isNotificationEnabled](homekit/hmcharacteristic/isnotificationenabled.md)
