如何实现这个例子:
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
如何实现这个例子:
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
如您链接的示例所示,您是否首先要求“精确位置”?
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 Docs 中找到更多信息:Google Assistant > Data > ON_PERMISSION。