如何在Alexa开发控制台上显示AccountLinkingCard?

时间:2019-05-27 06:54:13

标签: alexa-skill alexa-account-linking

首先,我不知道是否应该在这里询问Alexa问题!抱歉,因为我是JovoAlexa的新手。

我正在尝试使用jovo框架开发与帐户关联的技能。

唤醒该技能后,它会重定向到正确的意图,并向我显示if(!this.$request.getAccessToken())检查中的正确输出。

但是在Alexa开发人员控制台中,没有显示AccountLinkingCard。我该如何测试?我没有任何Alexa设备,但是,我已经在Android上安装了Alexa应用。我遇到的问题是,即使印度启用了搜索功能,我也看不到自己的技能。请提出建议。

我也尝试了Jovo调试器控制台,但是那里也没有AccountAcingCard。

这是我的代码:

"use strict";

// ------------------------------------------------------------------
// APP INITIALIZATION
// ------------------------------------------------------------------

const { App } = require("jovo-framework");
const { Alexa } = require("jovo-platform-alexa");
const { GoogleAssistant } = require("jovo-platform-googleassistant");
const { JovoDebugger } = require("jovo-plugin-debugger");
const { FileDb } = require("jovo-db-filedb");
const { rp } = require("request-promise");

const app = new App();

app.use(new Alexa(), new GoogleAssistant(), new JovoDebugger(), new FileDb());

// ------------------------------------------------------------------
// APP LOGIC
// ------------------------------------------------------------------

app.setHandler({
  LAUNCH() {
    return this.toIntent("HelloWorldIntent");
  },

  async HelloWorldIntent() {
    if (!this.$request.getAccessToken()) {
      this.$alexaSkill.showAccountLinkingCard();
      this.tell("Please link your account");
    } else {
      const access_token = this.$request.getAccessToken();
      let url = `https://api.amazon.com/user/profile?access_token=${access_token}`;

      await rp(url).then(body => {
        let data = JSON.parse(body);
        this.tell(data.user.id);
      });
    }
    //this.ask("Hello World! What's your name?", "Please tell me your name.");
  },

  MyNameIsIntent() {
    this.tell("Hey " + this.$inputs.name.value + ", nice to meet you!");
  }
});

module.exports.app = app;

我可以直接通过Alexa开发人员测试控制台显示和测试卡吗?

PS:还有一件事。 Jovo创建一个默认的Webhook网址,例如https://webhook.jovo.cloud/xxxxx,该网址必须在测试时运行。我可以为此使用自己的服务器URL并进行远程调用吗?如果是,是否有任何可用的教程?

0 个答案:

没有答案