---
title: Central Manager State Restoration Options
framework: corebluetooth
role: collectionGroup
role_heading: API Collection
path: corebluetooth/central-manager-state-restoration-options
---

# Central Manager State Restoration Options

Restore central manager state in scene-based apps.

## Overview

Overview In scene-based apps that adopt UISceneDelegate, the launchOptions dictionary is always nil on launch, and apps can no longer rely on the system to hand back central manager identifiers at launch. Instead, generate a stable UID for each CBCentralManager, persist it (for example, in UserDefaults) and pass it via CBCentralManagerOptionRestoreIdentifierKey when creating the manager on every launch. When restoration is available, Core Bluetooth calls centralManager(_:willRestoreState:) and passes the preserved state in the dict parameter. func makeCentralManager(     delegate: any CBCentralManagerDelegate ) -> CBCentralManager {     let defaults = UserDefaults.standard     let key = "MyCentralManagerUID"     let uid: String     if let saved = defaults.string(forKey: key) {         uid = saved     } else {         uid = UUID().uuidString         defaults.set(uid, forKey: key)     }     return CBCentralManager(         delegate: delegate,         queue: nil,         options: [CBCentralManagerOptionRestoreIdentifierKey: uid]     ) } CBCentralManagerRestoredStatePeripheralsKey contains peripherals that were connected or had a pending connection when the app stopped. CBCentralManagerRestoredStateScanServicesKey contains the service UUIDs your app was scanning for. CBCentralManagerRestoredStateScanOptionsKey contains the scan options that were active. If your app also acts as a peripheral, see Peripheral Manager State Restoration Options for the equivalent pattern using CBPeripheralManagerOptionRestoreIdentifierKey.

## Topics

### State Restoration Options

- [CBCentralManagerRestoredStatePeripheralsKey](corebluetooth/cbcentralmanagerrestoredstateperipheralskey.md)
- [CBCentralManagerRestoredStateScanServicesKey](corebluetooth/cbcentralmanagerrestoredstatescanserviceskey.md)
- [CBCentralManagerRestoredStateScanOptionsKey](corebluetooth/cbcentralmanagerrestoredstatescanoptionskey.md)

## See Also

### Initializing a Central Manager

- [init()](corebluetooth/cbcentralmanager/init().md)
- [init(delegate:queue:)](corebluetooth/cbcentralmanager/init(delegate:queue:).md)
- [init(delegate:queue:options:)](corebluetooth/cbcentralmanager/init(delegate:queue:options:).md)
- [Central Manager Initialization Options](corebluetooth/central-manager-initialization-options.md)
