Closed maurovm closed 2 years ago
I have successfully paired and connected to a given peripheral. After the device has been streaming data for a while, the user disconnected (or turned off) the device. How can my app get notified of events like these?.
Presumably, we need to forward the
func centralManager( _ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error? )
method from the Central Manager's delegate to a new "app delegate" we need to implement?
Good point! The central manager needs to be able to communicate events that happen out of its control. We can use a Publisher to notify clients.
I have successfully paired and connected to a given peripheral. After the device has been streaming data for a while, the user disconnected (or turned off) the device. How can my app get notified of events like these?.
Presumably, we need to forward the
method from the Central Manager's delegate to a new "app delegate" we need to implement?