Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] State Preservation and Restoration #6

Open
fvisticot opened this issue Jun 16, 2019 · 3 comments
Open

[iOS] State Preservation and Restoration #6

fvisticot opened this issue Jun 16, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@fvisticot
Copy link

My application is managing a BLE object and I need to manage all cases regarding connection.
A great article is describing the pb here:
https://uynguyen.github.io/2018/07/23/Best-practice-How-to-deal-with-Bluetooth-Low-Energy-in-background/

and Apple article:
https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW10

I do not see how the current library is managing State Preservation and Restoration.

Can you please help ?

What would be fine:

  • Allow to set an identifier when creating the centralManager:
myCentralManager =
[[CBCentralManager alloc] initWithDelegate:self queue:nil
options:@{ CBCentralManagerOptionRestoreIdentifierKey:
@"myCentralManagerIdentifier" }]
  • add a "callback" when the restoration is fired with devices and states :
- (void)centralManager:(CBCentralManager *)central
--
willRestoreState:(NSDictionary *)state {
 
NSArray *peripherals =
state[CBCentralManagerRestoredStatePeripheralsKey];
@valtbarbos
Copy link

Hi guys, any updates on this? This would be a useful feature

@fvisticot tks fo the articles

@toniree
Copy link

toniree commented Jun 6, 2020

Hi @valtbarbos I'm currently tackling a similar issue in my own project. Curious what your solution ended up being?

@valtbarbos
Copy link

Hi @valtbarbos I'm currently tackling a similar issue in my own project. Curious what your solution ended up being?

Im using another library.

https://github.com/valtbarbos/flutter_blue/tree/master

here an example of background and auto reconnection, tested with iOS 13.1
valtbarbos/flutter_blue@651b121

I hope it is useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants
@fvisticot @toniree @devxpy @valtbarbos and others