To be specific, this is the line you want in Runtime.jscript
CocoonJS.App.setAutoLockEnabled = function (enabled)
Just change it to disabled and it works very well.
I just noticed the new Cocoon builder, ingame, if users press Home on their device, it now suspend the game and goes to device screen and can resume instantly when they switch back. The old build, pressing Home would close the game, switching back restart it from ludei loading logo. So its a great improvement.
Testing the new WebGL screencanvas option with the latest C2 build and CocoonJS. Will update progress.
— thank you for this solution. It works great. My apps were getting rejected from the Amazon app store for the same reason, it would be nice if there was an option in Construct 2 to enable or disable that setting so we didn't have to edit every build
EDIT: looks like maybe this didn't fix my problem... it's still crashing after device wakes up