You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "jcesarmobile (Jira)" <ji...@apache.org> on 2019/11/29 12:18:00 UTC

[jira] [Closed] (CB-12846) WebView JS execution continues when app executes in background

     [ https://issues.apache.org/jira/browse/CB-12846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jcesarmobile closed CB-12846.
-----------------------------
    Resolution: Won't Do

closing since UIWebView is deprecated and it's going away in next release and the problem doesn't happen on WKWebView

> 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: cordova-ios@4.3.1
>            Reporter: Grant Patterson
>            Priority: Major
>
> 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
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org