Reputation: 33
with what i can replace " Network.connection"? it's no more valid !! please i need help
import { Network } from '@ionic-native/network';
isOnline(): boolean {
if(this.onDevice && Network){
return Network.connection!== Connection.NONE;
} else {
return navigator.onLine;
}
}
Upvotes: 0
Views: 61
Reputation: 2560
Check the documentation for the plugin: https://ionicframework.com/docs/native/network/
But in your case it seems to work with
return this.network.type != 'none';
After injecting the plugin of course.
Upvotes: 1