constructor(public navCtrl: NavController, public navParams: NavParams,
public camera:Camera,public databaseProvider:DatabaseProvider,
public backgroundRun:BackgroundRun,public http:HttpClient,
public http2:Http,public diagnostic:Diagnostic,
private platform:Platform,
) {
this.platform.ready().then(() => {
// this.diagnostic.isLocationAvailable().then( isAvailable => {
// console.log("Location available: " + isAvailable);
// }).catch(error=>{
// console.log("Location");
// console.log(error);
// });
this.diagnostic.getBluetoothState()
.then((state) => {
console.log(state);
if (state == this.diagnostic.bluetoothState.POWERED_ON){
// do something
} else {
// do something else
}
}).catch(e => console.error(e));
}).catch(error=>{
console.log(error);
});
}
error:
ERROR TypeError: Object(…) is not a function
at Diagnostic.isLocationEnabled (vendor.js:127427)
at ListPage.webpackJsonp.11.ListPage.ionViewWillEnter (main.js:506)
at ViewController._lifecycle (vendor.js:35671)
at ViewController._willEnter (vendor.js:35569)
at NavControllerBase._willEnter (vendor.js:73491)
at vendor.js:73384
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:5135)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)