I have a toy iOS app that's just for me. It's a native wrapper of a web-based WebAssembly-heavy game.
It's one of those where you set a task, and then wait for it to complete. Great for desktop browsers where you can just leave an open window in the corner of the display and work elsewhere.
WKWebView
, however, seems to go inactive and stops processing game content when the app is backgrounded. I'd like any way (evil hacks accepted) to keep this from happening, so that the game does not pause or go inactive.
I've tried a number of hacks, including:
- attaching the web view to the key window (deprecated in iOS 13 beta)
- using an audio session to keep the app alive in the background
- pumping the web view with
evaluateJavaScript
calls on a timer while in the background
...to no avail. Any solutions welcome!
(p.s., I'm aware of a couple other questions like this one, but want to ask my own to manage the bounty and also I'm not sure if the game being WASM makes a difference, vs. the other questions specifically calling out JavaScript)