androidjs icon indicating copy to clipboard operation
androidjs copied to clipboard

app's javascript 'stops' when another app gets focus

Open ajuga2 opened this issue 5 years ago • 7 comments

'myapp' functions normally when it has 'focus', But when you activate another app (for example a brower). the front (index.html) and back (main.js) of myapp stops (so main.js doesn't keep on running in the background). But myapp's webview isn't closed. When you click on myapp, you see a blank page followed by index.html being reloaded and main.js restarting

ajuga2 avatar Sep 04 '20 13:09 ajuga2

have you restricted your apps to be running in background?

Chhekur avatar Sep 13 '20 15:09 Chhekur

No, I use story-app as a template and modify main.js. I haven't modified package.json, etc

ajuga2 avatar Sep 13 '20 15:09 ajuga2

then it might be a bug, we'll look into it. join our slack community too, for faster responses. Slack Channel for support and discussion

Chhekur avatar Sep 13 '20 15:09 Chhekur

It doesn't stop immediately but after about 30 seconds. I've tried using setTimeout to send messages between front and back every second but that has no effect. It looks like the OS stops the front and back processes. When the app gets focus again, it starts with a white screen after which view.html is loaded.

ajuga2 avatar Sep 14 '20 07:09 ajuga2

further is it possible to use wake_lock to keep cpu running?

notYou263 avatar Sep 23 '20 19:09 notYou263

It is not the phone which goes to 'sleep'.

ajuga2 avatar Sep 24 '20 08:09 ajuga2

Has anyone managed to resolve this issue?

omarcosr avatar Jan 27 '23 13:01 omarcosr