[jira] [Commented] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560754#comment-13560754 ] Kuan Yi Ming commented on CB-2096: -- Shazron, would it be safe to assume that the documentation for online events in version 2.2.0 be updated to reflect the new timing change? Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560754#comment-13560754 ] Kuan Yi Ming edited comment on CB-2096 at 1/23/13 3:40 PM: --- Shazron, would it be safe to assume that the documentation for online events in version 2.2.0 onwards be updated to reflect the new timing change? The current documentation still mentions that the online event listener is to be added in onDeviceReady(). was (Author: yiming.kuan): Shazron, would it be safe to assume that the documentation for online events in version 2.2.0 be updated to reflect the new timing change? Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13561039#comment-13561039 ] Shazron Abdullah commented on CB-2096: -- Added a doc issue: CB-2291 Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (CB-2096) Online/Offline events no longer trigger when event listener is added
Kuan Yi Ming created CB-2096: Summary: Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online Reporter: Kuan Yi Ming Assignee: Joe Bowser Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kuan Yi Ming updated CB-2096: - Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. (was: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online) Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Joe Bowser Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shazron Abdullah updated CB-2096: - Component/s: CordovaJS Added CordovaJS tag, could be a JS thing. Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Joe Bowser Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Bowser updated CB-2096: --- Unable to reproduce on the Nexus 10 running 4.2.1. Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Joe Bowser Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Bowser updated CB-2096: --- Assignee: Shazron Abdullah (was: Joe Bowser) I can't reproduce it on the devices I have here. Want to see if it's reproducible on iOS and if not close this? Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13538365#comment-13538365 ] Kuan Yi Ming commented on CB-2096: -- Hi Joe, In your cases, does the online event fire immediately after device ready? That is the behavior I get in 2.1.0 but not in 2.2.0. Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13538594#comment-13538594 ] Shazron Abdullah commented on CB-2096: -- I can confirm on iOS. Using the full example, it appears that the event fires before you can call document.addEventListener on it in the page. Using the same example, the workaround is to add your event listener in the onLoad call, before listening for deviceready. {code} function onLoad() { document.addEventListener(online, onOnline, false); document.addEventListener(deviceready, onDeviceReady, false); } {code} Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CB-2096) Online/Offline events no longer trigger when event listener is added
[ https://issues.apache.org/jira/browse/CB-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shazron Abdullah resolved CB-2096. -- Resolution: Won't Fix Solution: This is a matter of timing. The event does fire. Online/Offline events no longer trigger when event listener is added Key: CB-2096 URL: https://issues.apache.org/jira/browse/CB-2096 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaJS, iOS Affects Versions: 2.2.0 Environment: Android 4.1, 4.2, iOS 6. Affects both simulators and devices. Reporter: Kuan Yi Ming Assignee: Shazron Abdullah Priority: Minor The online and offline event behaviour has changed from 2.1.0 to 2.2.0. In 2.1.0, the online event fires immediately when the event listener was added if there is an Internet connection, but doesn't in 2.2.0. Those events work fine in all other instances though when turning on/off mobile data etc. Is this change by design, or is it a bug? Use the full example from http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
RE: online/offline Events
In lib/common/plugin/network.js on Line 49 if (info === none) { Am I wrong or will this statement never be true since the plugins return the connection as Connection.NONE? What I'm seeing is that the event online is fired as Connection.NONE is passed in Markus -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Dienstag, 13. November 2012 18:41 To: dev Subject: Re: online/offline Events The spec says to fire an online event whenever the connection type changes, and to fire an offline event only when you lose your connection. It's not the most obvious, but probably your multiple event firing is working as intended. To answer your second question, I think what you're looking for is navigator.onLine. It's derived from the connection type here: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=63736a954762b17d4383239a8afa46a81ce88a3a;hb=HEAD#l31 On Tue, Nov 13, 2012 at 9:00 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I'm able to successfully setup a webOS specific service call in the initialize() function in platform.js ... this will keep track of any connection changes but fires multiple events in case Wifi is turned on (and not connected to an AP) and then again if connected with an AP. I convert those events to offline/online document events (via cordova.fireDocumentEvent). Is there a way to add a global online/offline status/variable somewhere and only fire document events if there's an actual change from offline to online? Markus -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Mittwoch, 7. November 2012 16:27 To: dev Subject: Re: online/offline Events Here's the Android impl: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.gi t;a=blob;f=framework/src/org/apache/cordova/NetworkManager.java;h=5d87 91809227877d604c98cf029c26242d9642b8;hb=HEAD The JS performs a Connection.getConnectionInfo(), and then the native plugin returns the connection status but sets keepCallback to true. Then, whenever the connection type changes, it sends another plugin result and always sets keepCallback to true. On Wed, Nov 7, 2012 at 9:57 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I saw that ... but how is that handled by the platform specific plugins? Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:56 To: dev@cordova.apache.org Subject: Re: online/offline Events lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a =b lob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e660 10 5e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#on li ne http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#of fl in e Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus
Re: online/offline Events
Well that's not the way it works on Android. From the Java side we return constants like none, 3g, wifi, etc. so the comparison will work properly. As well the constant Connection.NONE evaluates to none so even if you were using the constant for comparison purposes it should still work. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 14, 2012 at 6:33 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: In lib/common/plugin/network.js on Line 49 if (info === none) { Am I wrong or will this statement never be true since the plugins return the connection as Connection.NONE? What I'm seeing is that the event online is fired as Connection.NONE is passed in Markus -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Dienstag, 13. November 2012 18:41 To: dev Subject: Re: online/offline Events The spec says to fire an online event whenever the connection type changes, and to fire an offline event only when you lose your connection. It's not the most obvious, but probably your multiple event firing is working as intended. To answer your second question, I think what you're looking for is navigator.onLine. It's derived from the connection type here: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=63736a954762b17d4383239a8afa46a81ce88a3a;hb=HEAD#l31 On Tue, Nov 13, 2012 at 9:00 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I'm able to successfully setup a webOS specific service call in the initialize() function in platform.js ... this will keep track of any connection changes but fires multiple events in case Wifi is turned on (and not connected to an AP) and then again if connected with an AP. I convert those events to offline/online document events (via cordova.fireDocumentEvent). Is there a way to add a global online/offline status/variable somewhere and only fire document events if there's an actual change from offline to online? Markus -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Mittwoch, 7. November 2012 16:27 To: dev Subject: Re: online/offline Events Here's the Android impl: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.gi t;a=blob;f=framework/src/org/apache/cordova/NetworkManager.java;h=5d87 91809227877d604c98cf029c26242d9642b8;hb=HEAD The JS performs a Connection.getConnectionInfo(), and then the native plugin returns the connection status but sets keepCallback to true. Then, whenever the connection type changes, it sends another plugin result and always sets keepCallback to true. On Wed, Nov 7, 2012 at 9:57 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I saw that ... but how is that handled by the platform specific plugins? Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:56 To: dev@cordova.apache.org Subject: Re: online/offline Events lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a =b lob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e660 10 5e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#on li ne http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#of fl in e Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus
Re: online/offline Events
The spec says to fire an online event whenever the connection type changes, and to fire an offline event only when you lose your connection. It's not the most obvious, but probably your multiple event firing is working as intended. To answer your second question, I think what you're looking for is navigator.onLine. It's derived from the connection type here: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=63736a954762b17d4383239a8afa46a81ce88a3a;hb=HEAD#l31 On Tue, Nov 13, 2012 at 9:00 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I'm able to successfully setup a webOS specific service call in the initialize() function in platform.js ... this will keep track of any connection changes but fires multiple events in case Wifi is turned on (and not connected to an AP) and then again if connected with an AP. I convert those events to offline/online document events (via cordova.fireDocumentEvent). Is there a way to add a global online/offline status/variable somewhere and only fire document events if there's an actual change from offline to online? Markus -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Mittwoch, 7. November 2012 16:27 To: dev Subject: Re: online/offline Events Here's the Android impl: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/src/org/apache/cordova/NetworkManager.java;h=5d8791809227877d604c98cf029c26242d9642b8;hb=HEAD The JS performs a Connection.getConnectionInfo(), and then the native plugin returns the connection status but sets keepCallback to true. Then, whenever the connection type changes, it sends another plugin result and always sets keepCallback to true. On Wed, Nov 7, 2012 at 9:57 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I saw that ... but how is that handled by the platform specific plugins? Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:56 To: dev@cordova.apache.org Subject: Re: online/offline Events lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=b lob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e66010 5e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#onli ne http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offl in e Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus
[jira] [Created] (CB-1829) Online/Offline events do not fire on subsequent pages of an app
Simon MacDonald created CB-1829: --- Summary: Online/Offline events do not fire on subsequent pages of an app Key: CB-1829 URL: https://issues.apache.org/jira/browse/CB-1829 Project: Apache Cordova Issue Type: Bug Components: Android Affects Versions: 2.2.0 Reporter: Simon MacDonald Assignee: Simon MacDonald Priority: Critical Fix For: 2.3.0 The move to CordovaPlugin has broken the online/offline events. The old plugin code called setContext on every page entry and onDestroy every time you leave the page. Now initialize is called only on the load of the first page, so when onDestroy is called when you leave that page the network listener is unregistered and never re-created on the next page. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: online/offline Events
lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e660105e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offline Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus
RE: online/offline Events
I saw that ... but how is that handled by the platform specific plugins? Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:56 To: dev@cordova.apache.org Subject: Re: online/offline Events lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e660105e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offlin e Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus
Re: online/offline Events
Here's the Android impl: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/src/org/apache/cordova/NetworkManager.java;h=5d8791809227877d604c98cf029c26242d9642b8;hb=HEAD The JS performs a Connection.getConnectionInfo(), and then the native plugin returns the connection status but sets keepCallback to true. Then, whenever the connection type changes, it sends another plugin result and always sets keepCallback to true. On Wed, Nov 7, 2012 at 9:57 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I saw that ... but how is that handled by the platform specific plugins? Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:56 To: dev@cordova.apache.org Subject: Re: online/offline Events lolz I didn't read what list this was on. The src for network.js is at: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=blob;f=lib/common/plugin/network.js;h=adaba5ae8b6ec825986712d8b99e660105e56ae9;hb=HEAD The way we have it setup is the native side sends the JS side an update whenever the network connection changes. If the type == 'none' then we fire an offline event. Otherwise you fire the online event. Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: I was actually looking for a code example (in cordova-js) of a platform that sends out those events (because I'm investigating how to add support for those to webOS) Markus -Original Message- From: Simon MacDonald [mailto:simon.macdon...@gmail.com] Sent: Mittwoch, 7. November 2012 15:39 To: dev@cordova.apache.org Subject: Re: online/offline Events http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#online http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offlin e Simon Mac Donald http://hi.im/simonmacdonald On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus markus.leutwy...@hp.comwrote: Is there a platform that sends out online/offline event to the document when the connection status changes? I didn't find any examples Thanks Markus