[英]How to get user location from google home device
如何實現此示例:
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助手>數據> ON_PERMISSION 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.