It has now been almost 10 hours that I've been struggling with Google Assistant's API, because Google has decided to deprecate conversations on its assistant, making any information search very confusing.
我已经被谷歌助手的API困扰了将近10个小时,因为谷歌已经决定不再支持在它的助手上进行对话,这使得任何信息搜索都非常混乱。
I would like to have a Google Action that allows me to communicate with my API.
我想有一个谷歌行动,允许我与我的API沟通。
I have created the action on the Google Console. I have ensured that my app can authenticate via OAuth.
我已经在Google控制台上创建了操作。我已经确保我的应用程序可以通过OAuth进行身份验证。
Now, when I try to add the action to Google Home, it asks me to log in. Once logged in and redirected to the required OAuth redirect_uri
, I cannot close the page.
现在,当我试图将该操作添加到Google Home时,它会要求我登录。一旦登录并重定向到所需的OAuth reDirect_uri,我就无法关闭该页面。
I understand that when adding an app like this, there should be a SYNC
event that triggers to discover new devices. My API has never received such an event, even though it seems to respond correctly via Postman.
我明白,当添加这样的应用程序时,应该有一个同步事件来触发发现新设备。我的API从未收到过这样的事件,尽管它似乎通过Postman正确响应。
I'm not sure if these two issues are related, but I can't find any resources that provide clues on the internet.
我不确定这两个问题是否相关,但我在互联网上找不到任何提供线索的资源。
I tried sending the event myself via the SmartHome API (requestSync), but apparently, this is a step that should be done after this initial SYNC.
我尝试通过SmartHome API(请求同步)亲自发送事件,但显然,这是应该在初始同步之后完成的步骤。
I tried to fire events via Postman to the fulfillment endpoint I setup in google action, my API receive the message.
我试图通过Postman将事件发送到我在Google Action中设置的实现端点,我的API接收消息。
If you want some parts of my code, I'm using ngrok to serve my app hosted locally to the internet. I have a backend with nestjs (endpoints and logic) and another project in nodesjs for the smarthome integration (that is just supposed to receive Intent and call the right nestjs endpoints.
如果你需要我的部分代码,我使用ngrok来为我的应用程序提供本地托管到互联网的服务。我有一个带有nestjs(端点和逻辑)的后端,还有一个nodesjs中的项目用于smarthome集成(它只需要接收Intent并调用正确的nestjs端点)。
Here are the dependencies I needed at some point. It may be usefull to include it if you think I missed something or don't use the best librery for what I need
以下是我在某些情况下需要的依赖项。如果您认为我遗漏了什么,或者没有使用最好的图书馆来满足我的需要,那么添加它可能会很有用
"actions-on-google": "^3.0.0",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"googleapis": "^126.0.1",
"googleapis-common": "^7.0.0",
"@googleapis/homegraph": "^4.0.6",
更多回答
Please provide enough code so others can better understand or reproduce the problem.
请提供足够的代码,以便其他人能够更好地理解或重现问题。
我是一名优秀的程序员,十分优秀!