setInterval(function(){
if(!isOnline && navigator.onLine){
isOnline = true;
console.log("Back online!");
}
else if(isOnline && !navigator.onLine){
isOnline = false;
console.log("Lost connection!");
}}, 100);
Is it possible to subscribe to data from 'navigator.online'?
The above method seems to be working fine in developer options, when comes to real-time it only checks whether my device is connected to a network or not.
What I want is how to check the status of the internet connectivity.