iPhone auto-lock while playing

I don’t know about a solution with Defold that would work right now, but looks like this is the kind of style native devs use

-(void)callEveryTwentySeconds
{
// DON’T let the device go to sleep during our gameplay
[[UIApplication sharedApplication] setIdleTimerDisabled:NO]; // required hack
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}

If that kind of thing was possible in Defold then you could detect lack of any accelerometer movement at all after so long and then allow it to auto lock again.