isBluetoothEnabled

Ask, and ye shall receive.
es3
Posts: 2
Joined: 13:20, 03 Jul 2015

isBluetoothEnabled

Postby es3 » 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.

es3
Posts: 2
Joined: 13:20, 03 Jul 2015

Re: isBluetoothEnabled

Postby es3 » 07:44, 07 Jul 2015

Well, I've done some tests and discovered that the above code works when apk is built on cordova and installed on a device, but not on Evothings Client app.
Also, I've noticed that other plugins, i.e. katzer/cordova-plugin-local-notifications also has issues on Evothings Client but not on built apk.
Both plugins had to be added before cordoba build, but they work nice on apk.

Am I missing some step? I've read those and other plugins are pre-packaged in Client App, so I can't guess where the problem could be.


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 9 guests