Persist BLE device connection in the background- Swift,iOS

Hello there,
I am trying to connect to a BLE Device which emits like 20 data-points per second and I am writing all of that to a file. The actual problem occurs when I the application goes in background.

The Subject listener listening to those events pauses (for obvious iOS reasons, I guess) and resumes when app is in foreground again.

Long story short:-
I don't want to miss any data points. It should be a seamless experience where a user can be working out and doesn't want the app to be always in the foreground.

What could possibly be a solution for that? Can background fetch help me do that? If yes, I want to have no lag between the data points so should i set the
Code Block
miniumInterval
to 1 second?
This would be a good starting point if you want to communicate with a BLE device in the background:

Core Bluetooth Background Processing for iOS Apps:
https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html

Persist BLE device connection in the background- Swift,iOS
 
 
Q