cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <>
Subject [jira] [Commented] (CB-12846) WebView JS execution continues when app executes in background
Date Sat, 03 Jun 2017 01:32:04 GMT


Shazron Abdullah commented on CB-12846:

The core itself does not continue executing endlessly (there is no event polling) - it is
triggered to pull in commands by JavaScript sending a gap:// url. There is one timer here
that gets cleared:

I couldn't possibly repro this exactly - You could try profiling your app in Safari Web Inspector
to see what's going on.

> WebView JS execution continues when app executes in background
> --------------------------------------------------------------
>                 Key: CB-12846
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-ios
>    Affects Versions: cordova-ios@4.3.1
>            Reporter: Grant Patterson
> I'm using a [Cordova plugin|] that
integrates [a third-party SDK|] to listen
for bluetooth beacon sighting events. As expected, my app is allowed to run for 10 seconds
in the background with the [bluetooth-central UIBackgroundMode|].
Once the necessary processing is completed, the JS event loop runs until the 10-second window
closes. Because beacon sightings happen as frequently as several per second, the app runs
in the background constantly, killing the user's battery. I can setInterval() in JS with a
1000ms interval and it runs successfully every time; my Angular app runs $digest cycles in
the background which are unnecessary and quite expensive.
> I think I need a way for the native plugin code to relinquish execution and return the
app to the background.
> StackOverflow: []

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message