I have a website to play the game. When user plays the game in my web, the ios device auto sleep and turn off the screen then the game can't play anymore.
Do you know that and any idea for that?
Thanks so much!
I understand that you want to prevent the user's device to go to sleep when your game is open but the user doesn't touch the screen for a period of time.
There is no official support in iOS for this kind of feature.
NoSleep.js tries to offer some "hacky" way to keep the device awake, but according to it's issues it's not very reliable and clearly not future-proof.
If you want to have more control on the device consider the creation of a native app for your game.