I iCAB Well-Known Member Licensed User Longtime User Jul 23, 2021 #1 Hi Guys, We are working on an app that communicates with a Bluetooth device. As part of the requirements the app should be able to continue to do so in background mode, but not when the phone is locked. So we need a way/event to detect the lock/unlock actions. I found this article, but not sure how to use it with B4I and if it is the right way of doing it or not: https://stackoverflow.com/questions...to-check-if-the-ios-device-is-locked-unlocked Thanks, iCAB Last edited: Jul 23, 2021
Hi Guys, We are working on an app that communicates with a Bluetooth device. As part of the requirements the app should be able to continue to do so in background mode, but not when the phone is locked. So we need a way/event to detect the lock/unlock actions. I found this article, but not sure how to use it with B4I and if it is the right way of doing it or not: https://stackoverflow.com/questions...to-check-if-the-ios-device-is-locked-unlocked Thanks, iCAB
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2021 #2 How are you keeping the connection active while in the background? Is this a store app? Upvote 0
I iCAB Well-Known Member Licensed User Longtime User Jul 26, 2021 #3 Thanks, Erel for your reply! Erel said: How are you keeping the connection active while in the background? Click to expand... We are using an SDK that needs to continuously scan for Bluetooth devices. If a device of interest, is found, it connects to the device, exchanges some information, and then disconnect. Erel said: Is this a store app? Click to expand... Yes, the app will be published to the store. Upvote 0
Thanks, Erel for your reply! Erel said: How are you keeping the connection active while in the background? Click to expand... We are using an SDK that needs to continuously scan for Bluetooth devices. If a device of interest, is found, it connects to the device, exchanges some information, and then disconnect. Erel said: Is this a store app? Click to expand... Yes, the app will be published to the store.
Erel B4X founder Staff member Licensed User Longtime User Jul 27, 2021 #4 iCAB said: We are using an SDK that needs to continuously scan for Bluetooth devices. If a device of interest, is found, it connects to the device, exchanges some information, and then disconnect. Click to expand... This is not trivial to do. Are you using one of the standard background modes? Have you seen this answer: https://stackoverflow.com/a/43624669/971547 ? Upvote 0
iCAB said: We are using an SDK that needs to continuously scan for Bluetooth devices. If a device of interest, is found, it connects to the device, exchanges some information, and then disconnect. Click to expand... This is not trivial to do. Are you using one of the standard background modes? Have you seen this answer: https://stackoverflow.com/a/43624669/971547 ?
I iCAB Well-Known Member Licensed User Longtime User Jul 27, 2021 #5 Thanks Erel for your reply! Erel said: This is not trivial to do. Are you using one of the standard background modes? Click to expand... This is what we are using B4X: Expand Collapse Copy #PlistExtra: <key>UIBackgroundModes</key><array><string>processing</string><string>remote-notification</string><string>location</string><string>bluetooth-central</string><string>bluetooth-peripheral</string><string>audio</string></array> Erel said: Have you seen this answer: https://stackoverflow.com/a/43624669/971547 ? Click to expand... Yes, but I was hoping it is not the case as the post is from 2017, or perhaps that there is some workaround. iCAB Upvote 0
Thanks Erel for your reply! Erel said: This is not trivial to do. Are you using one of the standard background modes? Click to expand... This is what we are using B4X: Expand Collapse Copy #PlistExtra: <key>UIBackgroundModes</key><array><string>processing</string><string>remote-notification</string><string>location</string><string>bluetooth-central</string><string>bluetooth-peripheral</string><string>audio</string></array> Erel said: Have you seen this answer: https://stackoverflow.com/a/43624669/971547 ? Click to expand... Yes, but I was hoping it is not the case as the post is from 2017, or perhaps that there is some workaround. iCAB