0

如何实现这个例子:

      let device = this.googleAction().getRequest().getDevice();
      console.log(device);
      this.tell('Thanks for your precise location');

https://raw.githubusercontent.com/jovotech/jovo-framework-nodejs/master/examples/google_action_specific/appAskForPermission.js

4

1 回答 1

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 Docs 中找到更多信息:Google Assistant > Data > ON_PERMISSION

于 2018-03-17T17:41:53.540 回答