渐进式Web应用信标搜索 [英] Progressive web app beacon search

查看:123
本文介绍了渐进式Web应用信标搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以仅使用网络技术通过渐进式Web应用程序搜索信标数据(uuid,url等),而无需使用本机移动技术(Android,ios,...)?

Is it possible to search for beacon data (uuid, url, ...) with a progressive web application using just web technologies that is without using native mobile technologies (Android, ios, ...)?

先谢谢了.

推荐答案

不幸的是,从2020年7月起这是不可能的.尽管Google一直在研究

Unfortunately, this is not possible as of July 2020. While Google has been working on the WebBluetooth project to bring support for many bluetooth operations to the browser, at least in Google Chrome implementations on Android 6+, Mac or ChromeOS.

在撰写本文时,尚无法扫描信标.该API要求操作系统扫描符合要求条件的设备,然后让用户选择要使用用户界面连接的设备.这实际上排除了信标检测.

Scanning for beacons is not yet possible as of this writing. The API requires that the OS scan for devices matching a requested criteria, and then let the user choose a device to connect to using a user interface. This essentially rules out beacon detection.

蓝牙扫描API仍为草稿格式此处.

Bluetooth scanning APIs are still in draft form here.

编辑:@zurfyx在下面的答案中提到的API允许您扫描并连接到广告GATT服务,但不允许您读取广告中的数据.这是一个关键的区别,因为读取广告中的数据是实际检测蓝牙信标所需的关键功能.该API缺少该功能.如果没有该功能,就不可能检测到信标,只能连接到可能是Eddystone或其他基于服务广告的信标的BLE设备.

The APIs mentioned by @zurfyx in the answer below allow you to scan for and connect to an advertised GATT service, but do not allow you to read the data in the advertisement. This is a critical distinction, as reading the data in the advertisement is the key capability required for actual bluetooth beacon detection. That capability is missing from that API. Without that capability, it is impossible to detect a beacon, it is only possible to connect to a BLE device that might be an Eddystone or other service advertisement-based beacon.

更新2020年7月:截至2020年7月,Chrome浏览器不支持扫描任意广告.在此处查看状态: https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md

As of July 2020, Chrome does not support scanning arbitrary advertisements. See status here: https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md

这篇关于渐进式Web应用信标搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆