Browser Awareness of Bluetooth Beacons / iBeacons

故事扮演 提交于 2020-01-12 03:33:11

问题


Is there a way to make a browser aware of iBeacon devices in its proximity?

Similar to the way HTML5 Geolocation is working...

If not would this be something that can be achieved with a browser plug-in that can provide the detail to be consumed by javascript?


回答1:


Unfortunately, no. No web browsers have implemented any bridges between beacon detection and JavaScript.

I don't think a plugin approach is possible on mobile browsers (either iOS or Android), because neither browser supports asynchronous communication between external apps and JavaScript in Mobile Safari / Mobile Chrome. The best you could do is have a custom app that responds to a beacon, then launches a web page in the browser. But I realize that isn't what you are asking for.

If you want to build a native app with JavaScript, you can use Cordova (aka PhoneGap) and use plugins that provide beacon support. My company has one for our ProximityKit beacon framework:

https://github.com/RadiusNetworks/proximitykit-plugin-cordova

There is also a Cordova plugin that has basic beacon support here:

https://github.com/petermetz/cordova-plugin-ibeacon




回答2:


This looks promising (2016), Google Chrome developers site showing a desktop browser feature as a work in progress.

https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web?hl=en

Even though the Web Bluetooth API specification is not finalized yet, the Chrome Team is actively looking for enthusiastic developers (I mean you) to try out this work-in-progress API and give feedback on the spec and feedback on the implementation.

Web Bluetooth API is currently available to be enabled experimentally on your origin in Origin Trials, or locally on your machine using an experimental flag. The implementation is partially complete and currently available on Chrome OS, Chrome for Android M, Linux, and Mac.

Go to chrome://flags/#enable-web-bluetooth, enable the highlighted flag, restart Chrome and you should be able to scan for and connect to nearby Bluetooth devices, read/write Bluetooth characteristics, receive GATT Notifications and know when a Bluetooth device gets disconnected.

https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md




回答3:


There's a W3C specification for this Web Bluetooth, but there's no support yet: http://caniuse.com/#search=bluetooth.

If you decide to write a Phonegap plugin implementing this spec will be a good starting point.



来源:https://stackoverflow.com/questions/26873640/browser-awareness-of-bluetooth-beacons-ibeacons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!