[ https://issues.apache.org/jira/browse/CB-6746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Grieve resolved CB-6746. ------------------------------- Resolution: Fixed Assignee: Andrew Grieve Believe this was inadvertently fixed in 3.7.1 because in that version the Android native side doesn't enqueue any messages (drops them on the floor) until cordova.js is loaded. > Android's JS->Native ONLINE_EVENT does not work when cordova-js is not loaded > before the first message > ------------------------------------------------------------------------------------------------------ > > Key: CB-6746 > URL: https://issues.apache.org/jira/browse/CB-6746 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS > Affects Versions: 3.3.0 > Environment: Android > Reporter: Nick Eaket > Assignee: Andrew Grieve > Priority: Minor > > Currently if the Cordova-js Android Native->JS message handler registers on > the 'online'/'offline event. If a Native message is sent using > CordovaWebView.sendJavascript(...) and Cordova-js is currently not loaded, > the web view will remain in the 'offline' state. When Cordova-JS is finally > loaded, sending another message from Native->JS will continue to fill up the > message queue. Cordova-JS will currently never see if the Native code has > new messages. > Steps to reproduce: > 1. Create a new Cordova Android app > 2. Have the app load a web page that does not load cordova-js > 3. Have a Cordova Native plugin send a JavaScript message to the app. > (expected to be ignored, since cordova-js is not loaded) > 4. Navigate to a second web page that does load cordova-js > 5. Repeat step 3. > Expected: > Cordova-js should receive the message from step 5 > Suggested Fix: > Add a call to 'pollOnceFromOnlineEvent()' after the 'deviceready' event. > The call could potentially go here. > https://github.com/apache/cordova-js/blob/master/src/android/exec.js#L266 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org