Google上的操作:转化设备仅返回坐标

时间:2018-10-01 17:06:21

标签: dialogflow actions-on-google

我正在尝试获取用户所在的国家/地区。我的代码基本上是从示例中复制的,如下所示:

    else {
        conv.ask(new Permission({
            context: 'To get your country',
            permissions: ['DEVICE_COARSE_LOCATION', 'DEVICE_PRECISE_LOCATION'],
        }))
    }

})

app.intent('Get Permission', (conv, params, granted) => {
    // granted: inferred first (and only) argument value, boolean true if granted, false if not
    const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get
    const {location} = conv.device;
    console.log('dbgrrr  '+ Object.keys(location));

在最后一行,我试图找出位置对象的返回值,该对象应该为GoogleActionsV2Location类型的对象-但只有coordinates到达。如何到达需要的regionCode

0 个答案:

没有答案