Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive card sent by bot builder framework only shows "Sent a card" as the message, in iPhone #11726

Open
ChetanSharma-msft opened this issue Oct 25, 2024 · 1 comment
Assignees
Labels
needs-triage 🔍 teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label

Comments

@ChetanSharma-msft
Copy link
Collaborator

Steps to reproduce

Copied from: microsoft/botbuilder-dotnet#6774
Posted by: @hussain-nz

Details:
Version: 4.11.1.0

Describe the bug
When sending an Adaptive card via bot builder framework, it only shows "Sent a card" as the message, in iPhone. The bug seems to be caused by the ampersand character &. See screenshot below in "Screenshot" section.

To Reproduce
Steps to reproduce the behavior:

Bot message should be sent in the context of a custom Teams app, and will appear inside Chat/Activity tab of the custom Teams app. Code instructions below:
Create "Activity" object.
Populate ServiceUrl, Type, Summary.
Populate Attachments with HeroCard. HeroCard "Message" property should have ampersand character &.
Send Activity via turnContext.SendActivityAsync()
Open the Teams bot message inside an iPhone (Chat/Activity tab of the custom Teams app).
Code below in "Additional Context" section.

Additional context
Code to reproduce the issue:
` public async Task Send(ITurnContext turnContext, string messageText, CancellationToken cancellationToken = default)
{
if (!turnContext.Activity.IsTeamsBot())
{
throw new BotException($"{turnContext.Activity.ChannelId} channel is not supported for this kind of bot messages.");
}

    var campaignLaunchMessageActivity = new Activity();
    campaignLaunchMessageActivity.ServiceUrl = turnContext.Activity.ServiceUrl;
    campaignLaunchMessageActivity.Type = ActivityTypes.Message;
    campaignLaunchMessageActivity.Summary = messageText.StripHTML();
    campaignLaunchMessageActivity.Attachments = new List<Attachment>
    {
        new HeroCard
        {
            Text = messageText,
        }.ToAttachment(),
    };

    var response = await turnContext.SendActivityAsync(campaignLaunchMessageActivity, cancellationToken);

    return response.Id;
}`

Expected behavior

MessageText should be shown correctly on iPhone (instead of "Sent a card"). It's working correctly on Android and PC.

Actual behavior

Not working in iOS device.

Error details

Screenshot below that shows a working message on Android (left side) and incorrect message for iPhone (right side).
image

image

Copy link
Contributor

Hi ChetanSharma-msft! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@ChetanSharma-msft ChetanSharma-msft added the teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage 🔍 teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label
Projects
None yet
Development

No branches or pull requests

2 participants