---
title: "peripheralManager(_:willRestoreState:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheralmanagerdelegate/peripheralmanager(_:willrestorestate:)"
---

# peripheralManager(_:willRestoreState:)

Tells the delegate the system is about to restore the peripheral manager.

## Declaration

```swift
optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any])
```

## Parameters

- `peripheral`: The peripheral manager undergoing state restoration.
- `dict`: A dictionary containing information about the peripheral manager that the system preserved when your app stopped. For the available keys to this dictionary, see doc://com.apple.corebluetooth/documentation/CoreBluetooth/peripheral-manager-state-restoration-options.

## Discussion

Discussion This method only applies to your app if it opts in to state restoration by providing CBPeripheralManagerOptionRestoreIdentifierKey when initializing a CBPeripheralManager. The system invokes this method when relaunching your app to handle active advertising or peripheral operations in progress when your app stopped. If the system calls this method but the parameters are missing, your app is responsible for restoring its previous state. Initialize any services and characteristics your app requires, and resume any activities from where they stopped.

## See Also

### Monitoring Changes to the Peripheral Manager’s State

- [peripheralManagerDidUpdateState(_:)](corebluetooth/cbperipheralmanagerdelegate/peripheralmanagerdidupdatestate(_:).md)
- [Peripheral Manager State Restoration Options](corebluetooth/peripheral-manager-state-restoration-options.md)
