-
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
Online event fires every time app resumes from background (iOS and Android) #91
Comments
I'm also experiencing this issue, using cordova-plugin-network-information 2.0.2 and cordova-android 8.0.0, on an Android 8 device. |
Same on my side. On Android it also fired when using Camera from app for some stuff. At the moment im finished with Kamera and close it its like a app resume, which is normaly ok, but i dont see the reason to re-detect network then. |
Is this plugin still maintained? I'm also seeing this issue on plugin version 2.0.2 and cordova-android 8.0.0. |
I controlled this problem by using a variable
|
yes i have same issue for android 6.3.0 so downgrade to old version. |
I'm seeing the same on at least 2 Android devices (Android 7 and Android 9), using cordova-android 8.1.0. Downgrading to |
same Issue here. Downgrading to 2.0.1 worked for me. Cam someone please fix this? @janpio |
Anyone able to push a fix? |
@tryhardest downgrade to 2.0.1 |
why downgrade at @HansKrywaa @brassier @ipehimanshu did you try yet @paulovargatt variable above? Will downgrade if needs be yes but I will try with the variable first. Would be nice to get a fix. |
For android, this seems to be a problem with the Haven't experimented this myself, but this is what an stackoverflow answer suggests. Good news is that this API is deprecated, and there is supposedly a better way of obtaining connection info, using the NetworkCallback API. Bad news is, this API is only available as of API level 21 (Android 5.0) , so it will require a major update and will have to wait until android 4.4 is dropped completely. Android 4.4 will likely be dropped in cordova-android 9, but that is still work-in-progress. If the NetworkCallback API is indeed more consistent and reliable, it won't make it into master until we are ready to prepare a major release, and that release will only happen sometime after cordova-android 9 is release (assuming cordova-android 9 indeed drops support for android 4.4 (API level 19 & 20). PRs are still welcome, even if they need to wait for a major update cycle. Not experienced enough with iOS to comment on that side of this issue. |
Any update on this issue? |
This issue may actually have been fixed by #114 but that hasn't been released yet. You can test it out on using the nightly version. Do note that nightly versions aren't recommended for production use however. |
is it still resolved or not ? |
This may be fixed by #114 You can confirm if the issue still persists by using the |
@breautek sir |
Well I was going to suggest But yes, using git should also do the trick:
|
ok sir |
@breautek |
Thanks for confirming. This means on the next release the fix will be available for production use. Unfortunately I can't provide any ETA on this will be. |
@breautek - can you speak to any release plans for this issue? Thank you! |
Bug Report
Problem
The online event fires unreliably when an app moves from background to foreground.
This occurs on
iOS AND Android
for us.It might be related to #82 but it is definitely not resolved with 2.0.2
What is expected to happen?
Online event only fires when network connection was lost and is established again.
What does actually happen?
Online event fires every time the app was in background and comes to foreground again, even though wifi is connected at all times.
Information
We show a message to the user when he goes offline, and one when he goes online again, so we rely on the event listeners.
Offline works fine, but the online event fires every time the App comes from background to foreground although wifi is connected at all times.
The connection seems to go to `type: none' when the App goes to background, which makes the online event fire when the app comes to foreground again.
We pretty much use the code as in the Cordova documentation, so there's no special implementation that could affect the behavior.
Environment, Platform, Device
Tested on iOS (12.4) and Android (9 and 6.0.1)
Version information
React
cordova 9.0.0
Checklist
The text was updated successfully, but these errors were encountered: