Aws lambda 亚马逊Alexa技能-移动应用程序创建中的卡片

Aws lambda 亚马逊Alexa技能-移动应用程序创建中的卡片,aws-lambda,alexa-skills-kit,Aws Lambda,Alexa Skills Kit,我正在尝试在移动应用程序中制作一张卡片,该应用程序附加到Amazon帐户和当前技能 用“tellWithCard”调用EMIT函数就足够了吗?例如: that.emit(':tellWithCard', "Thank you for your visit", "Store Name", "Some description") 我分别尝试了所有这些功能,但不适用于我: that.emit(':tellWithCard', message, "Store Name", description) t

我正在尝试在移动应用程序中制作一张卡片,该应用程序附加到Amazon帐户和当前技能

用“tellWithCard”调用EMIT函数就足够了吗?例如:

that.emit(':tellWithCard', "Thank you for your visit", "Store Name", "Some description")
我分别尝试了所有这些功能,但不适用于我:

that.emit(':tellWithCard', message, "Store Name", description)
that.emit(':tellWithLinkAccountCard', message, "Store Name", description)

that.emit(':askWithCard', message, "Store Name", description)
that.emit(':askWithLinkAccountCard', message, "Store Name", description) 

是否还有其他功能?

是的,这就是您所需要的

以下是一个例子: (摘自原始回购协议的副本)

请确认您应该从服务模拟器获得如下响应:

{
  "version": "1.0",
  "response": {
  "outputSpeech": {
    "type": "SSML",
    "ssml": "<speak> lalalala </speak>"
  },
  "card": {
    "text": "This text will be displayed in the companion app card.",
    "title": "Hello World Card",
    "image": {
      "smallImageUrl": "https://imgs.xkcd.com/comics/standards.png",
      "largeImageUrl": "https://imgs.xkcd.com/comics/standards.png"
    },
    "type": "Standard"
  },
  "shouldEndSession": true
  },
  "sessionAttributes": {}
}
{
“版本”:“1.0”,
“答复”:{
“输出语音”:{
“类型”:“SSML”,
“ssml”:“拉拉”
},
“卡片”:{
“文本”:“此文本将显示在配套应用程序卡中。”,
“标题”:“你好,世界贺卡”,
“图像”:{
“smallImageUrl”:https://imgs.xkcd.com/comics/standards.png",
“大图像URL”:https://imgs.xkcd.com/comics/standards.png"
},
“类型”:“标准”
},
“shouldEndSession”:true
},
“会期贡献”:{}
}

但是请记住,从服务模拟器进行的测试不会在Alexa应用程序中创建实际的卡。为此,您需要使用设备。

谢谢您的回答。是的,我也用这种方法在设备上试过。设备已连接到同一帐户。。。但我可能做错了什么,而不是在这一部分的实施。您是否有任何其他想法会影响卡片发送?您是否在服务模拟器中得到此类答案?是的。我在“文本”模拟器、模拟器、“测试”执行、真实设备上以语音消息的形式接收答案,甚至通过HTTP POST接收记录到外部系统(专为测试而设计,在发出之前调用)晚上Amazon帐户中是否有一些特殊配置?现在我为其他功能创建了全新的Lambda,也许我能避免这样的错误。保持每个人都处于更新状态。@user2960820在amazon帐户/应用程序中无需执行任何特殊操作。
{
  "version": "1.0",
  "response": {
  "outputSpeech": {
    "type": "SSML",
    "ssml": "<speak> lalalala </speak>"
  },
  "card": {
    "text": "This text will be displayed in the companion app card.",
    "title": "Hello World Card",
    "image": {
      "smallImageUrl": "https://imgs.xkcd.com/comics/standards.png",
      "largeImageUrl": "https://imgs.xkcd.com/comics/standards.png"
    },
    "type": "Standard"
  },
  "shouldEndSession": true
  },
  "sessionAttributes": {}
}