google-actions-on-google-actions帐户关联登录状态始终为“ ERROR”

问题描述 投票:1回答:1

我从链接到google帐户的google帐户操作文档中获得了此示例代码。 signin.status始终为“ ERROR”。我在手机和Google Home Mini上尝试了操作控制台模拟器,Google Assistant应用,并启用了个人结果。但是结果在所有情况下都是相同的。

const express = require('express');
const bodyParser = require('body-parser');

const {actionssdk, SignIn} = require('actions-on-google');
const app = actionssdk({
  // REPLACE THE PLACEHOLDER WITH THE CLIENT_ID OF YOUR ACTIONS PROJECT
  clientId: <client_id>,
});

// Intent that starts the account linking flow.
app.intent('actions.intent.MAIN', (conv) => {
  conv.ask(new SignIn('To get your account details'));
});
// Create an Actions SDK intent with the `actions_intent_SIGN_IN` event.
app.intent('actions.intent.SIGN_IN', (conv, params, signin) => {
    console.log(signin)
  if (signin.status === 'OK') {
    const payload = conv.user.profile.payload;
    conv.ask(`I got your account details, ${payload.name}. What do you want to do next?`);
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to do next?`);
  }
});

app.intent('actions.intent.TEXT', (conv) => {
    conv.close("bye");
})

//Run server
const expressApp = express().use(bodyParser.json());
expressApp.post('/', function(req,res){
    app(req,res);
});
expressApp.listen(8080,() => {console.log("listening")});

这是我返回的登录对象{'@type':'type.googleapis.com/google.actions.v2.SignInValue',状态:“错误”}

编辑

我的actions.json如下

{
  "actions": [
    {
      "description": "Default Welcome Intent",
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "fulfilment function"
      },
      "intent": {
        "name": "actions.intent.MAIN",
        "trigger": {
          "queryPatterns": [
            "talk to Care Cat"
          ]
        }
      }
    },
    {
      "description": "Everything Else Intent",
            "name": "allElse",
            "fulfillment": {
                "conversationName": "fulfilment function"
            },
            "intent": {
                "name": "actions.intent.TEXT"
            }
    }
  ],
  "conversations": {
    "fulfilment function": {
      "name": "fulfilment function",
      "url": <url>
    }
  },
  "locale": "en"
}

可能是因为它仍然是尚未发布的测试应用程序?

有人可以帮我吗?

node.js google-cloud-platform actions-on-google account-linking
1个回答
0
投票

在您的Google Cloud Platform帐户中,检查您的IAM设置并启用Dialogflow API管理员

文档以获取更多详细信息:https://cloud.google.com/dialogflow/docs/access-control

© www.soinside.com 2019 - 2024. All rights reserved.