isBluetoothEnabled
Posted: 13:27, 03 Jul 2015
Hello,
I'm trying to add Peter Metz's method isBluetoothEnabled to the Relaxation Beacons demo, in order to check if bluetooth is enabled or not.
I've read at this forum that this method is included in evothings client but when testing, console always shows the same error:
Uncaught TypeError: Object #<c> has no method 'isBluetoothEnabled'
Code added to "relaxation" demo is the following :
cordova.plugins.locationManager.isBluetoothEnabled()
.then(function(isEnabled){
console.log("isEnabled: " + isEnabled);
if (isEnabled) {
cordova.plugins.locationManager.disableBluetooth();
} else {
cordova.plugins.locationManager.enableBluetooth();
}
})
.fail(console.error)
.done();
Thanks in advance for your response.
I'm trying to add Peter Metz's method isBluetoothEnabled to the Relaxation Beacons demo, in order to check if bluetooth is enabled or not.
I've read at this forum that this method is included in evothings client but when testing, console always shows the same error:
Uncaught TypeError: Object #<c> has no method 'isBluetoothEnabled'
Code added to "relaxation" demo is the following :
cordova.plugins.locationManager.isBluetoothEnabled()
.then(function(isEnabled){
console.log("isEnabled: " + isEnabled);
if (isEnabled) {
cordova.plugins.locationManager.disableBluetooth();
} else {
cordova.plugins.locationManager.enableBluetooth();
}
})
.fail(console.error)
.done();
Thanks in advance for your response.