Ennova
Ennova

Reputation: 682

Display Additional Text in Teams Client Toast for incoming message that contains an Adaptive Card?

We have a Teams bot that sends messages containing adaptive cards to end users (via the Bot Framework). When the chat window is not in focus, the Teams client will show the incoming message in a Toast/Popup that appears in the bottom right of the screen. However when the message contains just a card, the toast is nondescript and there is no hint to the user as to what the "Sent a card" maybe all about. So all card message toasts appear to be the same. See image

Is it possible to display a text message alongside the "Sent a card" in Toast so the user can decide whether to immediately interact with the message or ignore it. Any other visual cues we can provide that would appear in the Toast?

enter image description here

Upvotes: 0

Views: 354

Answers (1)

Tim Cadenbach
Tim Cadenbach

Reputation: 1565

You have to set a summary when sending cards via Bot Framework.

Like this:

var response = MessageFactory.Text(string.Empty);
response.Attachments.Add(cardAttachment);
response.Summary = "showing custom greeeting from the Bot - rather than a card";
await turnContext.SendActivityAsync(response, cancellationToken);

The summary is shown in the notification instead of "sent a card"

This was implemented quite some time ago.

Upvotes: 2

Related Questions