evothings / cordova-ble

Bluetooth Low Energy plugin for Cordova
http://www.evothings.com/
Apache License 2.0
242 stars 103 forks source link

Behaviour of startScan when Bluetooth is turned off #48

Closed ghost closed 8 years ago

ghost commented 9 years ago

Problem/feature request:

"I think that the startScan method should fail immediately when executed if the BLE is disabled on the phone. As for now it seems like it just thinks that it is actually scanning."

Some possible solutions:

There could also be functions for checking if Blutooth is on/off, and turn Bluetooth on/off.

ghost commented 9 years ago

Thanks, just tested this on both iOS and Android and it does work. A dialog is displayed if Bluetooth is off. Probably the reporter used an older version of the plugin. Will investigate.

ghost commented 9 years ago

Investigated further. It seems sometimes the dialog to request BLE to be turned on is not displayed on iOS. We have not found the cause of this. The dialog displays first time app is started if BLE is off. But does not display again. The workaround is to turn BLE on manually in this case.

ghost commented 8 years ago

This now works on Android and iOS by displaying popup menus where the user can turn Bluetooth on. Closing issue.