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

BLE IOS Running on Background Mode is unstable #854

Open
sangtran1711 opened this issue Mar 20, 2024 · 2 comments
Open

BLE IOS Running on Background Mode is unstable #854

sangtran1711 opened this issue Mar 20, 2024 · 2 comments

Comments

@sangtran1711
Copy link

Describe the bug
My app try to read data from a thermometer device, the device advertises every 3, 6, 9 or 12 minutes based on device calculation and my app sometime didn't receive data for 1-2 hours or more.

To Reproduce
Steps to reproduce the behavior:
App run

  1. Connect to device using connectToDevice()
  2. Read from characteristic
  3. Disconnect
  4. Reconnect to device again.

Expected behavior
My expectation is my app receive data from the device every 3, 6, 9 or 12 minutes at least.

Smartphone / tablet

  • Device: iPhone 11 Pro Max
  • OS: iOS 16
  • Package version: 5.0.3

Peripheral device

  • Vendor, model: Thermometer device

Additional context
My app flow is Connect to the device -> read data -> disconnect -> wait 2 seconds -> reconnect to the device again. This will be forever until the user unregister the device from the app. The app will run 1 or several days smoothly as I expected and then it started not receiving data for 1-2 hours and then received data again. Don't know if it is an issue or a limitation of IOS.

@Scottie-Fischer
Copy link

This could be because IOS can suspend applications. Without a restoration key and option for restoration:
CBCentralManager( delegate: centralManagerDelegate, queue: nil, options: [ CBCentralManagerOptionRestoreIdentifierKey: centralManagerRestoreID, CBCentralManagerOptionShowPowerAlertKey: true ] )
the app could remain suspended even if the bluetooth connection receives an update. Furthermore, if the app is suspended the connection could be severed while in the background. Honestly this restoration should be an added feature.

@drolpi
Copy link

drolpi commented Jul 3, 2024

@Taym95 are there any updates on this?

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

No branches or pull requests

3 participants