---
title: "peripheral(_:didUpdateNotificationStateFor:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheraldelegate/peripheral(_:didupdatenotificationstatefor:error:)"
---

# peripheral(_:didUpdateNotificationStateFor:error:)

Tells the delegate that the peripheral received a request to start or stop providing notifications for a specified characteristic’s value.

## Declaration

```swift
optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral providing this information.
- `characteristic`: The characteristic for which to configure value notifications.
- `error`: The reason the call failed, or nil if no error occurred.

## Discussion

Discussion Core Bluetooth invokes this method when your app calls the setNotifyValue(_:for:) method. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.
