I am developing an HTML5 game, primarily for iOS. It has a Node.js backend and uses a myriad of technologies, including jQuery, Socket.IO, and the Web Audio API. The game works fine. However, sometimes the device will lock (not freeze). I can play the game as normal, but neither the power nor home button will respond, and though the screen will dim, it will never go off completely. Alternately, sometimes when I push the home button, the apple logo will flash on the screen.
I can not regularly reproduce the error, making it very hard to debug. It seems to happen more frequently if I leave the device alone for several minutes, but sometimes it is fine and sometimes it won't exit.
I have been trying to trace this error for several weeks now. I have tried internet searches, resulting in a few possibilities, but none of the fixes panning out. I do not recall all of the fixes I have tried, but some follow:
- Adding a 2 second delay to the io.connect command, to make sure the page is done loading, not just 'ready'.
- Disabling "Guided Access" (the symptoms are very similar to having guided access active, and one bug I found said it would sometimes activate).
- Replacing instances of "+new Date" with Date.now()
I can not release the full source of the program, and am not sure which specific pieces would be of assistance in debugging it. If you can let me know what sections of the code to share, I could do that though.
Any assistance is greatly appreciated!
Christopher