diff --git a/ios/BleManager.swift b/ios/BleManager.swift index 9b9dbed0..08b470c8 100644 --- a/ios/BleManager.swift +++ b/ios/BleManager.swift @@ -751,7 +751,7 @@ class BleManager: RCTEventEmitter, CBCentralManagerDelegate, CBPeripheralDelegat peripheral.delegate = self } - NotificationCenter.default.post(name: Notification.Name("BleManagerCentralManagerWillRestoreState"), object: nil, userInfo: ["peripherals": data]) + self.sendEvent(withName:"BleManagerCentralManagerWillRestoreState", body: ["peripherals": data]) } } } diff --git a/src/types.ts b/src/types.ts index f7832fe3..bb54960e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -373,6 +373,13 @@ export interface BleManagerDidUpdateNotificationStateForEvent { readonly code: number; } +/** + * [iOS only] + */ +export interface BleManagerCentralManagerWillRestoreState { + peripherals: Peripheral[]; +} + /** * [Android only] *