botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Question] ThumbnailCard button does not work as expected in Microsoft Teams but works in Bot Emulator

Open operacha opened this issue 9 years ago • 1 comments

System Information (Required)

  • SDK Language: .NET/C#
  • SDK Version: 3.8.1
  • Development Environment: AZURE_APP

Issue Description

I am currently using a ThumbnailCard which has a button that leads to a website url for authentication purposes. The ThumbnailCard displays as expected in Microsoft Teams chat but clicking the button does nothing. The button does however work in Bot Emulator as expected.

Code Example

ThumbnailCard plCard = new ThumbnailCard()
 {
       Title = "Please login in order to complete creation of support request:",
       Subtitle = " ",
       Images = new List<CardImage>(),
       Buttons = GetCardActions(url, "signin")
 };
plAttachment = plCard.ToAttachment(); 

IMessageActivity response = context.MakeMessage();
response.Type = "message";

response.Attachments = new List<Attachment>();
response.Attachments.Add(plAttachment);

context.PostAsync(response);

operacha avatar Jul 12 '17 21:07 operacha

Issue has been fixed by using "openUrl":

Updated Code

Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "Get Started", value: url) }

operacha avatar Jul 13 '17 17:07 operacha