如何实现此示例:
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
答案 0 :(得分:0)
您是否首先要求“精确定位”,如您所链接的示例所示?
this.googleAction().askForPreciseLocation('Precise Location pre text');
如果用户授予您权限,则会跳转到“ON_PERMISSION”处理程序,您可以在其中访问信息,如下所示:
if (requestUser.permissions.indexOf('DEVICE_PRECISE_LOCATION') > -1) {
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
}
您可以在Jovo文档中找到更多信息:Google Assistant > Data > ON_PERMISSION。