MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
289 stars 513 forks source link

[Rendering] Teams Stage View not launching properly on Teams 2.1 #9603

Closed z3019494 closed 9 months ago

z3019494 commented 1 year ago

Copied from https://github.com/microsoft/AdaptiveCards/issues/8693

Target Platforms

Other

SDK Version

Unsure

Application Name

Microsoft Teams 2.1

Problem Description

Teams Stage View launches properly on Teams Classic (the SharePoint "app" that launches requires authentication).

However, it only appears with a blank screen on Teams 2.1.

In the Card JSON below, the Calendar view of absences button will try to launch the Teams Stage View with SharePoint app.

Screenshots

Animation

Card JSON

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.4",
    "msteams": {
        "width": "Full"
    },
    "body": [
        {
            "type": "Container",
            "bleed": true,
            "style": "warning",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "50px",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/Cover_Document.png"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "wrap": true,
                                    "size": "Large",
                                    "weight": "Bolder",
                                    "color": "Attention",
                                    "text": "**Work left for Sally Lee**"
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Friday, September 22, 2023",
                                    "wrap": true,
                                    "spacing": "None",
                                    "weight": "Bolder",
                                    "size": "Large",
                                    "color": "Accent"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "Hi team, please be aware of the following Teacher Absence Calendar entry. There may need to be printing performed for the casual relief teacher.",
            "wrap": true,
            "fontType": "Default",
            "size": "Small",
            "color": "Accent"
        },
        {
            "type": "FactSet",
            "facts": [
                {
                    "title": "🚦Status",
                    "value": "Created on Thursday, September 21, 2023 3:42:42 PM"
                }
            ],
            "separator": true
        },
        {
            "type": "FactSet",
            "facts": [
                {
                    "title": "🧑‍🏫 Teacher absent",
                    "value": "Sally Lee"
                },
                {
                    "title": "✅ Absence category",
                    "value": "Leave"
                },
                {
                    "title": "📅 Absence Date",
                    "value": "Friday, September 22, 2023"
                }
            ],
            "separator": true
        },
        {
            "type": "TextBlock",
            "text": "Brief notes (if any)",
            "wrap": true,
            "separator": true,
            "color": "Accent",
            "weight": "Bolder",
            "size": "Small"
        },
        {
            "type": "TextBlock",
            "text": "Away for first half of the day. On site for second half but helping Y12s.",
            "wrap": true,
            "spacing": "None"
        },
        {
            "type": "TextBlock",
            "text": "Staff notified",
            "wrap": true,
            "separator": true,
            "weight": "Bolder",
            "size": "Small",
            "color": "Accent"
        },
        {
            "type": "TextBlock",
            "text": "Hubert Lam | Isabelle Ham | Rajakrishnar Sekaran | Ritu BHAMRA | Martin Ho | Sally Lee | Josephine Kim | Caroline Kim | Rebecca Chaussivert | Zenia Chai | Caleb Kao | Minhua Lin",
            "wrap": true,
            "spacing": "None",
            "weight": "Lighter",
            "size": "Small",
            "color": "Accent"
        }
    ],
    "actions": [
        {
            "type": "Action.OpenUrl",
            "title": "View this entry on the Teacher Absence Calendar",
            "url": "https://teams.microsoft.com/l/stage/2a527703-1f6f-4559-a332-d8a7d288cd88/0?context=%7B%22contentUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2F_layouts%2F15%2Flistform.aspx%3FPageType%3D4%26ListId%3D783c1e41%252Dd855%252D44cd%252D8267%252Dcc2f79e84082%26ID%3D206%26ContentTypeID%3D0x0100A2FAB34A6BCE4C48A7743AFE7767020B004672A3B6A6BCFF47B5AE3DE6346AAEF8%22%2C%22websiteUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2F_layouts%2F15%2Flistform.aspx%3FPageType%3D4%26ListId%3D783c1e41%252Dd855%252D44cd%252D8267%252Dcc2f79e84082%26ID%3D206%26ContentTypeID%3D0x0100A2FAB34A6BCE4C48A7743AFE7767020B004672A3B6A6BCFF47B5AE3DE6346AAEF8%22%2C%22name%22%3A%22Work%20left%20for%20Sally%20Lee%20%28Friday%2C%20September%2022%2C%202023%29%22%7D",
            "style": "positive",
            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png",
            "id": "1"
        },
        {
            "type": "Action.OpenUrl",
            "title": "PDF for printing: 20230922 - Sally Lee - 154242.pdf",
            "url": "https://schoolsnsw.sharepoint.com/:b:/s/N1XHSGBP/mathematics/EXQAdFsbNz9Hgcpx3psVwDIBsjlfqbOEyRUq0b807_nq5Q",
            "style": "positive",
            "id": "2",
            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/pdf.png"
        },
        {
            "type": "Action.OpenUrl",
            "title": "Chat with Sally Lee",
            "url": "https://teams.microsoft.com/l/chat/0/0?users=da.lee31@det.nsw.edu.au",
            "style": "positive",
            "id": "3",
            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/teams.png"
        },
        {
            "type": "Action.OpenUrl",
            "title": "Calendar view of absences",
            "url": "https://teams.microsoft.com/l/stage/2a527703-1f6f-4559-a332-d8a7d288cd88/0?context=%7B%22contentUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2FLists%2FTeacher%2520Absences%2FCalendar.aspx%22%2C%22websiteUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2FLists%2FTeacher%2520Absences%2FCalendar.aspx%22%2C%22name%22%3A%22Calendar%20view%20of%20absences%22%7D",
            "style": "positive",
            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png",
            "id": "4"
        }
    ]
}

Sample Code Language

No response

Sample Code

No response

z3019494 commented 1 year ago

In the latest update to the Teams 2.1 client: Stage View which tries to open

See the following updated animated GIF: https://schoolsnsw-my.sharepoint.com/:i:/g/personal/hubert_lam2_det_nsw_edu_au/EdZMnljW6ZFOtwwULV4mtgABXApwwM6Lg3DZ0TCSUeJG7g?e=PuJxIi

Prasad-MSFT commented 1 year ago

@z3019494 - We have raised a bug for the same. We will inform you once we get any further update from engineering team. Thanks!

z3019494 commented 1 year ago

Update:

In the latest update to the Teams 2.1 client: Stage View which tries to open

  • the OneNote web app doesn't work
  • Any document stored on the SharePoint Document Library doesn't work
  • a SharePoint list does work.

See the following updated animated GIF: https://schoolsnsw-my.sharepoint.com/:i:/g/personal/hubert_lam2_det_nsw_edu_au/EdZMnljW6ZFOtwwULV4mtgABXApwwM6Lg3DZ0TCSUeJG7g?e=PuJxIi

An update: it does load Word Online files stored on SharePoint, but not PDFs. In Teams 1.0 it would load both Word Online & PDF (plus Excel etc).

Neither does the OneNote app work.

Adaptive card sample for PDF/OneNote:

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.4",
    "msteams": {
        "width": "full"
    },
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/Template.png",
                                    "width": "75px",
                                    "selectAction": {
                                        "type": "Action.OpenUrl",
                                        "id": "10"
                                    },
                                    "altText": "Assessment workflow"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "**2024 Year 07 Assessment Task 4 (Yearly/Trial)**",
                                    "weight": "Bolder",
                                    "size": "Large",
                                    "wrap": true,
                                    "color": "Accent"
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "Notification & Discussion (Staff Channel)",
                                    "wrap": true,
                                    "spacing": "None",
                                    "color": "Attention",
                                    "weight": "Bolder",
                                    "size": "Large"
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        }
                    ]
                }
            ],
            "bleed": true,
            "style": "attention"
        },
        {
            "type": "TextBlock",
            "text": "Dear <atTag><tagId>MDVhMGU2OWEtNDE4YS00N2MxLTljMjUtOTM4NzI2MWJmOTkxIyM5YzQxMWVkNC03NjU5LTRjMDktYTU4MC1hZDliYTE0ZGQzYWMjI3RvZ2FieUJBdTY%3D</tagId><groupId>9c411ed4-7659-4c09-a580-ad9ba14dd3ac</groupId></atTag>, please note the following Assessment Task Workflow has now commenced with the initial notification now available for review.\n\n Please provide feedback ASAP by speaking in person to Hubert Lam (Setter), or replying to this thread.",
            "wrap": true,
            "size": "Small",
            "isSubtle": true,
            "color": "Accent"
        },
        {
            "type": "Container",
            "bleed": true,
            "style": "emphasis",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "The following resources for revision is forecast to be provided no later than these dates:",
                    "weight": "Bolder",
                    "color": "Accent",
                    "wrap": true
                },
                {
                    "type": "FactSet",
                    "facts": [
                        {
                            "title": "Past Paper(s):",
                            "value": "Wednesday, October 4, 2023"
                        },
                        {
                            "title": "Past Paper Solution(s):",
                            "value": "Wednesday, October 4, 2023"
                        }
                    ]
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "Related documents and websites",
            "wrap": true,
            "weight": "Bolder",
            "color": "Accent"
        },
        {
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.OpenUrl",
                    "title": "Sentral Calendar",
                    "url": "https://normanhurb-h.sentral.com.au/webcal/calendar/4",
                    "style": "positive",
                    "id": "30",
                    "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sentral.png"
                },
                {
                    "type": "Action.OpenUrl",
                    "title": "Teaching Program",
                    "url": "https://schoolsnsw.sharepoint.com/:b:/s/N1XHSGBP/mathematics/EVA46h6xdWRBpvhwog9FdfQBOYc4JtCGv8W2M9p_iOiCkQ",
                    "style": "positive",
                    "id": "31",
                    "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png"
                },
                {
                    "type": "Action.OpenUrl",
                    "title": "Learning Programs (Student Editions)",
                    "url": "https://schoolsnsw.sharepoint.com/:f:/s/293YP4GC/EpYRilAICVtDpEHcOejpFl0Ba6t73Hr7JzT0SI5j_rEBFA?e=SWDaQl",
                    "style": "positive",
                    "id": "32",
                    "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png"
                }
            ],
            "spacing": "None"
        },
        {
            "type": "Container",
            "bleed": true,
            "style": "warning",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "Staff Notebook page for question paper feedback",
                    "wrap": true,
                    "weight": "Bolder",
                    "color": "Accent"
                },
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "2024 Year 07 Assessment Task 4 (Yearly/Trial)",
                            "url": "https://teams.microsoft.com/l/stage/0d820ecd-def2-4297-adad-78056cde7c78/0?context=%7B%22contentUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FNormanhurstBoysHS-MathematicsDepartment%2FSiteAssets%2FNormanhurst%2520Boys%2520HS%2520-%2520Mathematics%2520Department%2520Notebook%3Fwd%3Dtarget%2528_Assessment%2520Task%2520Collaboration%252FYear%252007%2520Tasks.one%257C71a4980c-9b9b-494c-97bb-2cc10831956c%252F2024%2520Year%252007%2520Assessment%2520Task%25204%2520%2528Yearly%255C%252FTrial%255C%2529%257C67ec3621-50eb-4c50-a0df-0a35423262ef%252F%2529%22%2C%22websiteUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FNormanhurstBoysHS-MathematicsDepartment%2FSiteAssets%2FNormanhurst%2520Boys%2520HS%2520-%2520Mathematics%2520Department%2520Notebook%3Fwd%3Dtarget%2528_Assessment%2520Task%2520Collaboration%252FYear%252007%2520Tasks.one%257C71a4980c-9b9b-494c-97bb-2cc10831956c%252F2024%2520Year%252007%2520Assessment%2520Task%25204%2520%2528Yearly%255C%252FTrial%255C%2529%257C67ec3621-50eb-4c50-a0df-0a35423262ef%252F%2529%22%2C%22name%22%3A%222024%20Year%2007%20Assessment%20Task%204%20%28Yearly%2FTrial%29%20Assessment%20Collaboration%20Page%22%7D",
                            "style": "positive",
                            "id": "staff-notebook-url",
                            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/onenote.png"
                        }
                    ],
                    "spacing": "None"
                }
            ]
        },
        {
            "type": "Container",
            "bleed": true,
            "style": "good",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "View notification and sign off",
                    "wrap": true,
                    "separator": true,
                    "color": "Accent",
                    "weight": "Bolder"
                },
                {
                    "type": "ActionSet",
                    "spacing": "None",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "Preview Assessment Task 4 (Yearly/Trial) Notification (PDF)",
                            "url": "https://teams.microsoft.com/l/stage/2a527703-1f6f-4559-a332-d8a7d288cd88/0?context=%7B%22contentUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2F%3Ab%3A%2Fs%2FN1XHSGBP%2Fmathematics%2FEY2YDfNEPmtPnYtiWisc2DcBRg0xNF_8SFDBdILkI7Cv7w%22%2C%22websiteUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2F%3Ab%3A%2Fs%2FN1XHSGBP%2Fmathematics%2FEY2YDfNEPmtPnYtiWisc2DcBRg0xNF_8SFDBdILkI7Cv7w%22%2C%22name%22%3A%22Review%20Assessment%20Task%204%20%28Yearly%2FTrial%29%20Notification%20%7C%20Open%20in%20browser%20to%20print%20to%20OneNote%20and%20give%20annotated%20feedback%22%7D",
                            "style": "positive",
                            "id": "0",
                            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/pdf.png"
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "Sign off",
                            "url": "https://teams.microsoft.com/l/stage/2a527703-1f6f-4559-a332-d8a7d288cd88/0?context=%7B%22contentUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2FLists%2FAssessment%20Task%20Workflow%20Tracker%2F%22%2C%22websiteUrl%22%3A%22https%3A%2F%2Fschoolsnsw.sharepoint.com%2Fsites%2FN1XHSGBP%2Fmathematics%2FLists%2FAssessment%20Task%20Workflow%20Tracker%2F%22%2C%22name%22%3A%22Sign%20Off%20on%202024%20Year%2007%20Assessment%20Task%204%20%28Yearly%2FTrial%29%22%7D",
                            "style": "positive",
                            "id": "1",
                            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png"
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "Assessment Task Workflow Tracker Item",
                            "url": "https://schoolsnsw.sharepoint.com/sites/N1XHSGBP/mathematics/_layouts/15/listform.aspx?PageType=4&ListId=7c171d94%2D1a5f%2D49a4%2Dbaea%2D6a44668d19c9&ID=89&ContentTypeID=0x01001488EC47C70ADA4BB23759CB9057C12F00396995EA5526DE41ADF1E9D7CDA38931",
                            "style": "positive",
                            "id": "2",
                            "iconUrl": "https://normanhurb-h.schools.nsw.gov.au/content/dam/doe/sws/schools/n/normanhurb-h/icons/sharepoint.png"
                        }
                    ]
                }
            ]
        }
    ]
}
JoooJooo commented 1 year ago

Could you please collect Teams client log and share ?

z3019494 commented 1 year ago

Could you please collect Teams client log and share ?

PROD-WebLogs-2023-10-18T00_22_47.316Z.zip

@JoooJooo - would this suffice?

z3019494 commented 10 months ago

It seems to be launching properly today!

image

Even OneNote was loading properly!

ydogandjiev commented 9 months ago

Hey @z3019494, the Stage View control is built for app developers to load their own app's content in it. In this case, it looks like you are trying to load content from other apps but how did you come up with the correct URLs to use? The URLs of other apps like OneNote and SharePoint are internal to these Teams Apps and not publicly documented. You cannot just take URLs that worked in the browser and load then within the Stage View because such URLs will not be able to correctly handle authentication when loaded in Teams.

For example, any SharePoint page embedded within Teams needs to use the TeamsLogon.aspx redirect to handle authentication as described in this blog post: https://bob1german.com/2020/01/06/teams-apps-with-sharepoint1/

The reason why you see this working sometimes and not others is that if you happen to have opened the OneNote or SharePoint app in the Teams Desktop Client before trying to load the stage then there will already be cookies available for the app to piggy back on. However, if the cookies have expired or the user has never opened the OneNote/SharePoint apps before, then the content you are loading in the stage will fail to authenticate.

As I mentioned above, this use of the stage is not supported or recommended. The stage is meant for you to load your own app's content, pointing to endpoints that you are in control of and have ensure they are ready for embedding withing Teams: https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/tab-requirements

And implement authentication as documented here: https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/authentication

This is not a breaking change in Teams 2.1. It has always worked this way.

z3019494 commented 9 months ago

Hi @ydogandjiev , I'm a pretty amateurish citizen developer, and I've just taken the idea from here:

https://ashiqf.com/2022/01/30/deep-link-sharepoint-news-post-in-teams-using-adaptive-card-and-power-automate/

But what you've mentioned makes perfect sense. Not sure how I ever got it to work more seamlessly in Teams 1.0 🤣

microsoft-github-policy-service[bot] commented 9 months ago

Tell us about your experience!

Hi z3019494! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards, Teams Platform