Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8462

Android triggers "online" event multiple times

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 4.1.3
    • None
    • None
    • Android KitKat

    Description

      Note: The bug entry form wouldn't let me enter the correct versions because it said they don't exist.

      Using Cordova CLI 4.2.0 and the latest (0.2.14) version of the org.apache.cordova.network-information plugin, we are seeing many many "online" events, resulting in Android devices repeatedly hitting our server for updates.

      To confirm the issue:

      • Create a new cordova project
      • platform add android
      • cordova plugin add org.apache.cordova.network-information

      Then add:

      document.addEventListener('offline', this.onOffline, false);
      document.addEventListener('online', this.onOnline, false);

      and console.log each time the event's received.

      I am seeing it 3 or 4 times each time I toggle Airplane mode on my Samsung S5. We are seeing this in our logs for a wide variety of Android devices in the wild however.

      Attachments

        Issue Links

          Activity

            People

              jcesarmobile jcesarmobile
              jfrumar Julian Frumar
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: