Google actions linking account doesn't fire SYNC event and doesn't close account linking page

59 Views Asked by At

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.

I would like to have a Google Action that allows me to communicate with my API.

I have created the action on the Google Console. I have ensured that my app can authenticate via 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.

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.

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.

I tried to fire events via Postman to the fulfillment endpoint I setup in google action, my API receive the message.

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.

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",

1

There are 1 best solutions below

0
Siddhant Priyadarshi On

Could you try developing your setup using the following codelab. If the system does not successfully complete the OAuth the system won’t receive the access tokens. Make sure your server sends the access and refresh tokens to Google.