We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 581811c + beafc8e commit a9652afCopy full SHA for a9652af
CoreBluetoothMock/CBMCentralManagerNative.swift
@@ -131,7 +131,15 @@ public class CBMCentralManagerNative: CBMCentralManager {
131
132
func centralManager(_ central: CBCentralManager,
133
willRestoreState dict: [String : Any]) {
134
- manager.delegate?.centralManager(manager, willRestoreState: dict)
+ var state = dict
135
+
136
+ if let peripherals = dict[CBCentralManagerRestoredStatePeripheralsKey] as? [CBPeripheral] {
137
+ state[CBMCentralManagerRestoredStatePeripheralsKey] = peripherals.map {
138
+ CBMPeripheralNative($0)
139
+ }
140
141
142
+ manager.delegate?.centralManager(manager, willRestoreState: state)
143
}
144
145
0 commit comments