Google助理应用程序未存储用户信息 [英] Google Assitant App not storing user information

查看:96
本文介绍了Google助理应用程序未存储用户信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在遵循Google提供的以下文档:
https: //developers.google.com/actions/identity/user-info

So I have been following this documentation provided by Google: https://developers.google.com/actions/identity/user-info

最近,request.userId已被弃用,因此是Google。因此,我转向了指定使用conv.user.storage的文档。

Recently, the request.userId was deprecated so Google. So I turned to this documentation which specifies use the conv.user.storage.

我尝试在我的应用中使用storage属性,但似乎没有存储任何用户数据,因为下次访问该存储时,会生成一个新用户

I have tried using the storage property in my app but it seems it doesn't store any user data as the next time I access it, the storage generates a new user id key.

const data = "Something you want to save";
let userId;
// if a value for userID exists in user storage, it's a returning user so we can
// just read the value and use it. If a value for userId does not exist in user storage,
// it's a new user, so we need to generate a new ID and save it in user storage.
if ('userId' in conv.user.storage) {
  userId = conv.user.storage.userId;
} else {
  // generateUUID is your function to generate ids.
  userId = generateUUID();
  conv.user.storage.userId = userId
}

以上是我尝试过的代码片段。我显然已经用我自己的函数替换了generateUUID()函数,并且每次都会生成一个随机的用户ID。问题是我在conv.user.storage中找不到 userId。

Above is the snippet of the code I tried. I've obviously replaced the generateUUID() function with my own and it's generating a random user id every time. The problem is I could never find 'userId' in conv.user.storage.

我也进入了我的Google Home应用,签出了[[查看用户存储空间],但是没有任何内容。

I also went in my Google Home app, checked out the "[View user storage]" but it had nothing.

推荐答案

userstorage取决于用户设置。尝试设置网络和启用并包含Chrome历史记录复选框的应用权限。

The userstorage depends on a user setting. Try setting the Web & App permission to on and include the chrome history checkbox.

可以在活动中心

这篇关于Google助理应用程序未存储用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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