The Adaptive card display is not displayed on the cortana channel but works well on teams and emulator

362 Views Asked by At

I have created a QnA bot and integrated cortana with it. I am able to see hero cards on the cortana channel but not adaptive cards. Though I get the attachment in my reply variable in my code, the card is not rendering. Alse the speak property of adaptive card seems to be deprecated.

Below is the json response i get as debugging info

{
  "botId": "ValoremReplyCortanaBot",
  "botRequest": {
    "type": "message",
    "id": "ru2O3ASCqo",
    "timestamp": "2019-05-28T12:28:38.6194349Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "valoremreplycortanabot"
    },
    "locale": "en-US",
    "text": "guide",
    "entities": [
      {
        "type": "Intent",
        "name": "None",
        "entities": []
      },
      {
        "type": "AuthorizationToken",
        "token": "##",
        "status": 0
      },
      {
        "type": "UserInfo",
        "current_location": {
          "StartTime": "2019-05-28T12:28:38.0673147Z",
          "EndTime": null,
          "Hub": {
            "Id": null,
            "Type": "Other",
            "Name": null,
            "Latitude": 10.0126075744629,
            "Longitude": 76.3658599853516,
            "Address": null
          },
          "VenueName": null,
          "Away": false
        },
        "name": {
          "GivenName": "##",
          "FamilyName": "##"
        },
        "email": "##@outlook.com"
      },
      {
        "type": "DeviceInfo",
        "supportsDisplay": "true"
      }
    ],
    "channelData": {
      "skillId": "cc3ef598-4f4f-444f-bd20-87a211581607",
      "skillProductId": "188779dd-2894-4cb3-b93f-b99955039ead",
      "isDebug": true
    }
  },
  "botResponse": {
    "type": "message",
    "timestamp": "2019-05-28T12:28:51.306281Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "valoremreplycortanabot"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "locale": "en-US",
    "text": "",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "version": "1.0",
          "body": [
            {
              "type": "TextBlock",
              "size": "large",
              "weight": "bolder"
            },
            {
              "type": "Image",
              "size": "stretch",
              "url": "##",
              "width": "100px",
              "height": "100px"
            }
          ],
          "actions": [
            {
              "type": "Action.OpenUrl",
              "url": "##",
              "title": "Guide Poster",
              "speak": "Guide Poster"
            }
          ]
        }
      }
    ],
    "entities": [],
    "replyToId": "ru2O3ASCqo"
  }
}
1

There are 1 best solutions below

3
Micromuncher On BEST ANSWER

The HTML renderer inside Cortana desktop is less forgiving than other clients. Check https://adaptivecards.io/explorer/TextBlock.html

To make sure every element has its REQUIRED fields.

It could be as simple as your TextBlock not having a text object.... Add "text": ""

Oh, and speak isn't deprecated. It is at a card level; peer to body. And... Cortana won't speak it by default. You need to copy it from the card and add it to the message https://github.com/microsoft/cortana-skills-samples/blob/master/Consumer/CSharp/V4Patches/07.using-adaptive-cards.diff