BLE connection does not terminate in background

1. To be sure I'm trying to do the right thing: Is it true that an app designed to communicate with a BLE peripheral should not have an active BLE connection when it is in the background if there is nothing it has to do except when in the foreground?


2. Assuming #1 is true how can I terminate the BLE connection when it does move to the background?


3. The app was written in TechBASIC and converted to a stand alone iOS app using the TechBASIC App Builder.


4. I'm using an iPad Air 2 with the latest iOS. I'm also using the latest Xcode.


Thanks in advance for your help,

Barbqman

Replies

1. Yes

2. iOS has multiple ways to notify your application that it is about to enter background mode. You need to search for the method that works best for you with your TechBASIC environment. Once you get that notification you simply call the API to disconnect from the BLE peripheral.