This method will help to make the smartphone fall asleep during the game. You do this as a setting and let the player decide whether to enable it or not.
I will not describe the complete order (only briefly), what needs to be done to build (you can see this in the documentation), but I will indicate the steps for installing the plugin and the necessary code in the game project. Procedure:
in the game project during the start of the scene (starting for the game) add the JavaScript code: window.plugins.insomnia.keepAwake();
This is done once. Now the smartphone screen will not fall asleep. To disable you need to execute the code: window.plugins.insomnia.allowSleepAgain();
now you need to add a plugin:
upload the project to a folder as indicated in the documentation;
Thank you, I’m glad it might come in handy for someone.
If you want, tell me about my game, I will be very grateful.
P.S. If you are going to teach manual assembly of a mobile application for Android, then do not forget to tell about the requirements from Google (Create and set up your app - Play Console Help). Otherwise, it will not work to load the game on Google Play, and when unloading the project from GDevelop, they are not taken into account (as it seemed to me, I did not see the settings in config.xml).
Thank you for your feedback!
Development lasted 6 weeks. It started on November 1st as part of the Game Jam, and on December 13th I was already uploading the 4th update (minor edits).