Swift : How to disconnect BLE devices in background if application is in background for 30 seconds

Viewed 390

My BLE device remains connected with the application when I put my application in the background.

I want to disconnect BLE communication if my application will be in the background for more than x seconds. (Example : x = 60 seconds)

I have tried to use Timer but it gives me an event when I came back to the foreground. I want to disconnect the BLE when the application is in the background.

Please let me know if anyone has faced & solved this expectation.

0 Answers
Related