I'm creating a watchOS application. The app should connect to a BLE tag, which sends distance values to the apple watch. If the distance falls below a given value, the application should give some feedback to the user about this.
Reading about core bluetooth and background tasks, it doesn't seems like it's possible. If I'm correct, when the application is suspended, it will no longer receive data from the BLE peripheral. How should I approach this task? Is it possible to run an application like this for 8 hours in the background? I can't find any more information about this, and it seems like it's impossible.
Pairing Apple Watch with iPhone is secured using an out-of-band process to exchange public keys, followed by the Bluetooth Low Energy (BLE) link shared secret. Apple Watch displays an animated pattern, which is captured by the camera on iPhone.
To do so, first, head to the 'Watch' app either from the home screen or from the App Library of your iPhone. Next, locate and tap on the 'General' option to proceed. After that, on the 'General' settings page, tap on the 'Background App Refresh' option to proceed.
Just build and run your iPhone application. Then, in the "Apple Watch" app on your iPhone, find your application, tap on it, and activate "Show App on Apple Watch". It may take a few seconds until the your Watch app has been installed.
There are restrictions to WatchOS apps using Bluetooth in the background, the main being:-
More details about this can be found in the following links:-
The only exception to this is if you use the HKWorkoutSession. More information about this can be found here.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With