无法接受Google的“操作”上的权限提示 [英] Unable to accept the permission prompt on Actions on Google

查看:113
本文介绍了无法接受Google的“操作”上的权限提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用获取位置名称的权限。

这是我的 index.js -



这是我对API.AI的意图:-

解决方案

事件 actions_intent_PERMISSION 需要附加到一个将在之后被称为用户的Intent,用户将授权发送信息。在Webhook中对其进行处理需要读取给出的信息并保存或立即对其进行操作。



您的代码正在循环,因为正在处理 request_permission 操作本身就是请求权限:

  function requestPermission(app) {
const权限= [
app.SupportedPermissions.NAME,
app.SupportedPermissions.DEVICE_PRECISE_LOCATION
];
app.askForPermissions(接您权限);
}

所以您将需要:




  • 已为事件设置 actions_intent_PERMISSION 的新意图


  • 具有与之关联的新操作字符串

  • ,并映射到一个新功能,该功能处理用户已同意的信息。


I am trying to get permissions for location and name for my app.
Here is my index.js - link

It seems to be stuck in a loop :-

Here are my intents on API.AI :-

解决方案

The event actions_intent_PERMISSION needs to be attached to an Intent that will be called after the user authorizes the information to be sent. The handling for it in the webhook needs to read the information given and save it or do something with it immediately.

Your code is looping because the code that is processing the request_permission action is, itself, requesting permission:

function requestPermission(app){
    const permissions = [
      app.SupportedPermissions.NAME,
      app.SupportedPermissions.DEVICE_PRECISE_LOCATION
    ];
    app.askForPermissions('To pick you up', permissions);
}

So you will need:

  • A new intent
  • that has actions_intent_PERMISSION set for the event
  • that has a new action string associated with it
  • and maps to a new function that handles the information that the user has consented to.

这篇关于无法接受Google的“操作”上的权限提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆