Run in Background doesn't Work Properly in Embedded Applications

I’m making a build with the “run in background” property disabled. When I upload that build to the Netlify to test it, it works as intended. Game musics stop when I minimize the browser. But if I upload the same build to the embedded android application, it doesn’t stop when I minimize the app. I think in embedded application, you need to do few extra steps to let your Unity game receive application minimized events.

Documentation states that this property is ignored on Android and iOS: Unity - Scripting API: Application.runInBackground

It may not even work as expected in the web browser, since the browser has authority over every tab’s content. It may simply stop any playback when minimized by default.

1 Like

I have tested the Unity Webgl app on Android and it seems this property works! It doesn’t play sound when I minimize the app if this property is disabled. So from what I understand, I need to somehow get app minimized message from Android’s WebView and redirect it to my Unity app, and within my Unity app I need to somehow stop the game.

Have you found any solution?