Cordova-plugin-network-information On Android Return Connection.type = None Even If There Is 4g Connection
There is a problem with Cordova-plugin-network-information on Android. Even if there is a 4G connection, sometimes, when I resume the app from the background and I check connection
Solution 1:
This is the workaround I'm currently using for this issue:
document.addEventListener("resume", function(){
navigator.connection.getInfo(function(type){
navigator.connection.type = type;
});
}, false);
See CB-14132 for an explanation of why.
Solution 2:
Try to use
Baca Juga
- Cordova To Android Studio Error Malformed \uxxxx Encoding
- Cordova Phonegap And Google Maps V3 Javascript Api: How To Add Backbutton Functionality When Clicking Either The License Link Or The Google Maps Logo
- How To Draw Brushes Or Shape Using Path When Moving Finger Fast In Andorid Canvas (generate Missing Point When User Move Finger Fast)
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if(navigator.onLine) {
alert("Internet Connect");
}else {
alert("No Internet");
}
}
Post a Comment for "Cordova-plugin-network-information On Android Return Connection.type = None Even If There Is 4g Connection"