---
title: "peripheralManagerDidStartAdvertising(_:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheralmanagerdelegate/peripheralmanagerdidstartadvertising(_:error:)"
---

# peripheralManagerDidStartAdvertising(_:error:)

Tells the delegate the peripheral manager started advertising the local peripheral device’s data.

## Declaration

```swift
optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral manager that is starting advertising.
- `error`: The reason the call failed, or nil if no error occurred.

## Discussion

Discussion Core Bluetooth calls this method when your app calls the startAdvertising(_:) method to advertise the local peripheral device’s data. If successful, the error parameter is nil. If a problem prevents advertising the data, the error parameter returns the cause of the failure.
