Grant Patterson created CB-12846:
------------------------------------
Summary: WebView JS execution continues when app executes in
background
Key: CB-12846
URL: https://issues.apache.org/jira/browse/CB-12846
Project: Apache Cordova
Issue Type: Bug
Components: cordova-ios
Affects Versions: [email protected]
Reporter: Grant Patterson
I'm using a [Cordova
plugin|https://github.com/happydenn/cordova-plugin-gimbal2] that integrates [a
third-party SDK|https://docs.gimbal.com/iosdocs/v2/devguide.html] 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|https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html].
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:
[https://stackoverflow.com/questions/44145031/stopping-background-javascript-activity-on-location-triggered-bluetooth-central]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]