You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been playing with the library this week and so far am pleased with the features. One thing I noticed is that the ReactiveCentralManagerDelegate seems incomplete. Specifically missing the willRestoreState instance method.
Thank you for your feedback and for exploring the library!
Regarding the missing centralManager:willRestoreState: method in the ReactiveCentralManagerDelegate, the reason it has not been implemented directly in the library is to avoid potential issues related to the lack of a restoration identifier.
If we were to implement it without providing a restoration identifier, it would lead warnings in the console.
Warning
API MISUSE: <CBCentralManager: 0x6000024c0280> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported.
To address this, the library has been designed to allow users to easily implement missing features themselves. Here's an example of how you can implement the centralManager:willRestoreState: method in your code:
// 1. - Implement your own delegate, overriding ReactiveCentralManagerDelegate
classMyCentralManagerDelegate:ReactiveCentralManagerDelegate{
// 2. - Implement the missing method
func centralManager(_ central:CBCentralManager, willRestoreState dict:[String:Any]){print(dict)
// Or perform any other necessary actions
}}
// 3. - During initialization of `CentralManager`, pass a custom delegate and options
letcm=CentralManager(centralManagerDelegate:MyCentralManagerDelegate(), options:[CBCentralManagerOptionRestoreIdentifierKey:"YourRestoreIdentifierKey"])
Feel free to reach out if you have any more questions or if there's anything else I can help you with.
I have been playing with the library this week and so far am pleased with the features. One thing I noticed is that the ReactiveCentralManagerDelegate seems incomplete. Specifically missing the willRestoreState instance method.
https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerdelegate/1518819-centralmanager
Perhaps this is still planned for a future release. If so please let us know when!
Thanks.
The text was updated successfully, but these errors were encountered: