I'm building a home automation system, I have chosen iPad as the main hub/bridge device to control lots of bluetooth devices (some custom made using RFDuino).
The iPad (iOS 8.4.1) is mounted on the wall and plugged into charger all the time.
I need to choose the right approach to make the app run all the time to control the devices and receive updates, trigger events etc.
The question is: Is there a way to disable the screen visualy? Dimming it down is not good enough; it would be best if the screen were switched off, like in the locked device state.
In simple words, can I employ a black screen saver?
If the answer for above is no: Is there a way to force the app to run in the background forever?
One thing to highlight here. This app does not go to Apple Store so the solution might be a dirty workaround
Thanks in advance
Tested so far:
let backgroundQueue = dispatch_get_global_queue(QOS_CLASS_BACKGROUND,0)
func applicationDidEnterBackground(application: UIApplication) {
application.beginBackgroundTaskWithName("myBgTask", expirationHandler: nil)
dispatch_async(self.backgroundQueue, myBackgroundTask)
}
func myBackgroundTask() {
NSThread.sleepForTimeInterval(1)
dispatch_async(self.backgroundQueue, myBackgroundTask)
}
This approach keeps app running in the background for 3 minutes only.
Keep searching...
proximityMonitoringEnabled
property toYES
and cover the proximity sensor (the dot adjacent to the ear speaker that isn’t the camera), it should turn the screen off automatically without sending your application to the background. – VikkiUIBackgroundMode: bluetooth-central
in your Info.plist? – Duple