Keep screen alive iOS

Does anyone know how to ensure that an app keeps the iPad screen alive while it is active, like a navigation application?

With a very quick search I found this Swift code:

UIApplication.shared.isIdleTimerDisabled = true

I leave turning that into a Xojo Declare as an exercise for the reader.

1 Like

Included in iOSDesignExtensions

Edit: maybe not actually… I will add it if it isn’t in there.

1 Like

Yeah, I thought it would be there, but couldnt spot it.
Im currently going to test this:

Declare Sub isIdleTimerDisabled Lib "UIKit" Selector "isIdleTimerDisabled" (p as ptr,v as boolean)

call isIdleTimerDisabled (myWindowPtr,v)

AppExtensionsXC.idleTimerDisabled is now available in iOSDesignExtensions

2 Likes