Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 23, 2018 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/733e8ff27157f9d7aad42430d3c4f1ce to your computer and use it in GitHub Desktop.
Save uno-de-piera/733e8ff27157f9d7aad42430d3c4f1ce to your computer and use it in GitHub Desktop.
import { Injectable } from '@angular/core';
import { Diagnostic } from '@ionic-native/diagnostic';
@Injectable()
export class CheckHardwareProvider {
/**
* @param diagnostic
*/
constructor(
private diagnostic: Diagnostic
) {
console.log('Hello CheckHardware Provider');
}
public stateWifi() {
this.diagnostic.isWifiAvailable().then(available => {
if( ! available ) {
this.diagnostic.switchToWifiSettings();
}
},
error => {
alert(JSON.stringify(error));
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment