权限响应未正确处理 [英] Permission response not handled correctly

查看:85
本文介绍了权限响应未正确处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ApiAiApp模块在node.js中执行以下命令:

  app.askForPermission('要知道今天是哪一天
app.SupportedPermissions.DEVICE_PRECISE_LOCATION);

我在Google模拟器中的操作中获得了以下内容。



它会正确提示我回答,但随后却感到困惑,无法识别我的答案!我的API.AI代理中是否缺少或损坏了某些东西?在 askForPermission 之后,没有其他实现呼叫。





您可以将Action设置为对您的网络挂钩有意义的任何内容,



如果您需要跟踪权限请求的发起位置,并通过其他操作来处理,则请确保启用该功能。 ,您可以设置一个上下文并根据不同的上下文设置使用不同的处理意图。



后备意图方法之所以有效,是因为从那时起,没有更好的匹配方法了。 t使用 actions_intent_PERMISSION 指定了常规Intent。但是,这不是最佳选择,因为它可以匹配用户的其他情况。


Following this command in node.js using the ApiAiApp module:

app.askForPermission('To know what day it is where you are',
                     app.SupportedPermissions.DEVICE_PRECISE_LOCATION);

I get the following in the Actions on Google Simulator.

It correctly prompts for my response, but then is confused and doesn't recognize my answer! Is there something missing or broken in my API.AI agent? After the askForPermission, there are no other fulfillment calls.

解决方案

The problem is likely that you need to set an Intent that will be triggered when the permission is granted. You do this by setting the Event to actions_intent_PERMISSION.

This will look something like this:

You can set the Action to whatever makes sense for your webhook, and be sure to enable webhook fulfillment for the Intent as well.

If you need to keep track of where the permission request was initiated from, and handle it through a different Action, you can set a Context and have different handling Intents based on different Context settings.

The Fallback Intent method works because there is no better match at that point since you hadn't specified a regular Intent with actions_intent_PERMISSION. It isn't the best choice, however, since it could match other situations from your user.

这篇关于权限响应未正确处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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