iOS Question Phone Locked

iCAB

Well-Known Member
Licensed User
Longtime User
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:

iCAB

Well-Known Member
Licensed User
Longtime User
Thanks, Erel for your reply!

How are you keeping the connection active while in the background?
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.

Is this a store app?
Yes, the app will be published to the store.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
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.
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

Well-Known Member
Licensed User
Longtime User
Thanks Erel for your reply!

This is not trivial to do. Are you using one of the standard background modes?

This is what we are using
B4X:
#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>


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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…