You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/04/08 19:52:35 UTC

[GitHub] [cordova-plugin-network-information] rolinger opened a new issue #107: Android no internet triggering `online` function

rolinger opened a new issue #107: Android no internet triggering `online` function
URL: https://github.com/apache/cordova-plugin-network-information/issues/107
 
 
   # Bug Report
   
   ## Problem: 
   On Android, app starts with internet access, move phone into airplane mode and the `online` function triggers when the `offline` function should trigger.  This is happening about 50% of the time.  After taking phone off airplane mode, I can see `online` function trigger again and then on a 2nd time putting phone into airplane mode do I finally see it go `offline`
   
   ### What is expected to happen?
   Moving phone into airplane mode should trigger the `offline` function - every time.
   
   
   ### What does actually happen?
   On first time putting phone into airplane mode - I see `online` function trigger.  After restoring phone and then putting back into airplane mode a 2nd time, the `offline` triggers as its supposed to.  Its only happening on the first time.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   Included above.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   Plugin version 2.0.2
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Android...its happening on Android 5 through 9. - all my test devices.
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   Plugin Version: 2.0.2
   
   Ionic:
      Ionic CLI         : 5.4.2 (C:\Users\RPO\AppData\Roaming\npm\node_modules\ionic)
      Ionic Framework   : ionic1 1.0.0
      @ionic/v1-toolkit : 1.0.22
   
   Cordova:
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : android 8.1.0
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, (and 30 other plugins)
   
   Utility:
      cordova-res : 0.6.0
      native-run  : 0.2.8
   
   System:
      NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
      npm    : 6.4.0
      OS     : Windows 7
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [x ] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-plugin-network-information] PieterVanPoyer commented on issue #107: Android no internet triggering `online` function

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #107: Android no internet triggering `online` function
URL: https://github.com/apache/cordova-plugin-network-information/issues/107#issuecomment-612674892
 
 
   Hi
   
   In our company we do not rely on the 'offline' and 'online' events.
   In our project, we allways check the navigator.connection.type before every api call.
   
   const networkState = navigator.connection.type;
   if (networkState === 'none') {
   console.log('We are offline');
   } else {
   console.log('We are online');
   }
   
   Can you check the navigator.connection.type when you receive the online event when switching to airplane mode?
   Or can you refactor to work with the type property instead of the events and share the results?
   
   Kind regards

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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