NPM install |
Step 1 : npm install @capacitor/network
Step 2 :
import { Network } from '@capacitor/network
constructor() {
this.checkNetworkConnection();
}
checkNetworkConnection(){
Network.addListener('networkStatusChange', status => {
console.log('Network status changed', status);
});
const logCurrentNetworkStatus = async () => {
const status = await Network.getStatus();
console.log('Network status:', status);
};
}
No comments:
Post a Comment