We are working on an app that is somewhat similar in nature to Apple's Animoji app and are facing the problem that the iPhone will go to sleep while the user is recording a video message.
In a regular app this can be prevented via
UIApplication.shared.isIdleTimerDisabled = true
However that is not an option in an iMessage app.
Is there any way to prevent the iPhone from sleeping while the user is recording a video in our app?