-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android no internet triggering online
function
#107
Comments
Hi In our company we do not rely on the 'offline' and 'online' events. const networkState = navigator.connection.type; Can you check the navigator.connection.type when you receive the online event when switching to airplane mode? Kind regards |
Hello BR |
@PieterVanPoyer - I just saw your solution on how you are handling this. Are you certain this is working as you think it does? https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation How are you handling As well, https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/type |
@rolinger the implementation of cordova for Android and ios have nothing to do with the experimental browser implementation in the browsers. Cordova does not use its own webview for ios. The implementation of ios and Android is handled on the native part of the app. In my setup it used to be working good. We checked the FWIW, the most recent version of this plugin is 3.0.0. Kind regards |
@PieterVanPoyer - I am asking these detailed questions because I am considering moving to your method. Need to understand the pitfalls. In your method, Yup...running 3.0.0 for sometime now. |
Hey This should be the possible constants. With their effective values : https://github.com/apache/cordova-plugin-network-information/blob/master/www/Connection.js But, be aware, due to privacy concerns the types are not always fully provided. For that reason I do not check any other types. |
Bug Report
Problem:
On Android, app starts with internet access, move phone into airplane mode and the
online
function triggers when theoffline
function should trigger. This is happening about 50% of the time. After taking phone off airplane mode, I can seeonline
function trigger again and then on a 2nd time putting phone into airplane mode do I finally see it gooffline
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, theoffline
triggers as its supposed to. Its only happening on the first time.Information
Included above.
Command or Code
Plugin version 2.0.2
Environment, Platform, Device
Android...its happening on Android 5 through 9. - all my test devices.
Version information
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 ([email protected])
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
The text was updated successfully, but these errors were encountered: