Hello! We're porting a game from android/iOS to WebGL and the problem is that we save player data when appliaction loses focus or pauses via OnAppliacitonPause/Focus. This function gets called in WebGL builds when you switch to another tab or move focus to another part of the page. However if user just closes the tab, there is no callback for us to save his data.
The question is - can the callback on tab close or browser quit can be implemented for WebGL? Im trying to make JS function "onbeforunload" work but no success so far. Any other way to achieve this?
↧