Google app maker 如何在google app maker中使用蓝牙?

Google app maker 如何在google app maker中使用蓝牙?,google-app-maker,Google App Maker,我正在尝试创建一个按钮,该按钮可以onClick,运行客户端脚本(myFunction();)通过Chrome连接到蓝牙设备 但是,它返回以下错误: SecurityError:从跨源iframe调用requestDevice() 请求蓝牙的代码如下所示: /* jshint esnext:true */ function myFunction() { navigator.bluetooth.requestDevice({ filters: [{ services: ['heart_rate

我正在尝试创建一个按钮,该按钮可以
onClick
,运行客户端
脚本(myFunction();)
通过Chrome连接到蓝牙设备

但是,它返回以下错误:

SecurityError:从跨源iframe调用requestDevice()

请求蓝牙的代码如下所示:

/* jshint esnext:true */
function myFunction() {
  navigator.bluetooth.requestDevice({ filters: [{ services: ['heart_rate'] }] })
.then(device => { /* ... */ })
.catch(error => { console.log(error); });
}