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

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

问题描述

是否可以使用渐进式 Web 应用程序搜索信标数据(uuid、url 等),而无需使用原生移动技术(Android、ios 等),而仅使用 Web 技术?

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 一直致力于 WebBluetooth 项目 为浏览器带来对许多蓝牙操作的支持,至少在 Google 中在 Android 6+、Mac 或 ChromeOS 上实现 Chrome.

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 年 6 月的公告由 Apple 提供 在可预见的未来,这使得在 iOS 我们的应用程序上无法进行蓝牙扫描.

截至 2020 年 7 月,Chrome 不支持扫描任意广告.在此处查看状态:https://github.com/WebBluetoothCG/网络蓝牙/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

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

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