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/01/31 20:51:44 UTC

[GitHub] [cordova-plugin-network-information] breautek commented on issue #91: Online event fires every time app resumes from background (iOS and Android)

breautek commented on issue #91: Online event fires every time app resumes from background (iOS and Android)
URL: https://github.com/apache/cordova-plugin-network-information/issues/91#issuecomment-580906459
 
 
   **For android**, this seems to be a problem with the `Connectivitymanager.getActiveNetworkInfo()` with certain conditions being met on the device, one of which is the app going into the background.
   
   Haven't experimented this myself, but this is what an [stackoverflow answer](https://stackoverflow.com/a/45231746/4685664) suggests.
   
   Good news is that this API is deprecated, and there is supposedly a better way of obtaining connection info, using the [NetworkCallback](https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback.html) 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.

----------------------------------------------------------------
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