Hello,
I have been asked to develop an iOS app that sits in the background and locks the screen programmatically. I have searched the documentation and struggled to find a solution.
The app is for a retail store that has 60+ iPads displaying product information in safari using guided access. We have previously had a native iOS app that displays the web content in a wkwebview but we found the content heavy site performed better in safari.
We require the lock screen functionality due to the fact that the retail parks power is switched off overnight which is causing the iPads battery to run flat.
I have been tasked to build an app that sits in the background and locks the screen automatically depending on the devices batteryState. I have built the foundations for this by building a music application with AVAudioPlayer that uses the audioPlayerDidFinishPlaying as a hook to detect the devices battery state.
Do you have any suggestions as to how I may be able to lock the screen programmatically in the background to preserve the devices battery?
Thank you,