Git Product home page Git Product logo

Comments (4)

petermetz avatar petermetz commented on June 1, 2024

If memory serves, at the moment there is no way to query the state of Bluetooth on the device nor any way to query if monitoring has the necessary preconditions met in general.

Sounds like a reasonable thing to implement either through the didFailSomething callbacks getting exposed in the Delegate of the DOM, or if that's not feasible, by explicitly providing access to the CoreBluetooth framework's relevant API elements.

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 1, 2024

If you want something iOS only in theory the peripheralManagerDidUpdateState event would tell you if the device would work for now. Bluetooth is only on when the state is CBPeripheralManagerStatePoweredOn , so if you listen to this event for CBPeripheralManagerStatePoweredOff and CBPeripheralManagerStatePoweredOn states you will get if Bluetooth in on or not. When the Peripheral Manager stats up it also appears to fire an initial state through this event too, so it seems like it would do what you want, it's just not cross-platform, and to make it cross-platform would be pretty straight forward. Lets add a task to add to the library.

from cordova-plugin-ibeacon.

niroam avatar niroam commented on June 1, 2024

Hi Guys,

I'm also struggeling with how to warn the user if BLE is not supported, i.e the plugin is used in an app that gets run on an older Iphone4, i can see the following event is fired
PeripheralManagerStateUnsupported

as there is a console log

peripheralManagerDidUpdateState() state: PeripheralManagerStateUnsupported

any chance we could account for this case as well ? although im not sure what happens when Android doesnt have BLE capability ?

Cheers
Niro

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 1, 2024

Now added as isBLuetoothEnabled

from cordova-plugin-ibeacon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.