From 69a86320b367bfad055505ec6ae222976de5ee99 Mon Sep 17 00:00:00 2001 From: Prithvi-MSFT Date: Thu, 7 Mar 2024 10:18:46 +0530 Subject: [PATCH 1/5] added changes for opening stage view through deep link --- .../TabInStageView/Views/Home/SampleTab.cshtml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml index 9d2ed8ded7..de7779d0d3 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml +++ b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml @@ -16,10 +16,17 @@ // Application base url and this redirects to Index view var contentUrl = window.location.origin; + + var context = { + contentUrl: contentUrl, + websiteUrl: contentUrl, + name: "DemoStageView", + openMode: "popOutWithChat" + } - // Passing the values and encoding the url while implementing the deeplink from tab - let url = "https://teams.microsoft.com/l/stage/" + appId + "/0?context={\"contentUrl\":\"" + contentUrl + "\",\"websiteUrl\":\"" + contentUrl +"\",\"name\":\"DemoStageView\"}"; - microsoftTeams.app.openLink(url); + const encodedContext = encodeURIComponent(JSON.stringify(context)); + + microsoftTeams.app.openLink("https://teams.microsoft.com/l/stage/" + appId + "/0?context="+encodedContext+"); }; From dd9a54c594c56f2fe94d89389726a95c236b3bcb Mon Sep 17 00:00:00 2001 From: Mohammed Furquan Date: Thu, 21 Mar 2024 11:59:59 +0530 Subject: [PATCH 2/5] Deeplink Updated --- .../Views/Home/SampleTab.cshtml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml index de7779d0d3..4575183cbc 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml +++ b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml @@ -2,10 +2,9 @@ - From b409e0f201b480c12d66ff8cd1e86989dce5ee43 Mon Sep 17 00:00:00 2001 From: Mohammed Furquan Date: Thu, 4 Apr 2024 09:35:09 +0530 Subject: [PATCH 3/5] Pushed Bot all cards manifest and Deeplink Updates --- .../csharp/demo-manifest/bot-all-cards.zip | Bin 4491 -> 4488 bytes .../csharp/TabInStageView/Bots/ActivityBot.cs | 5 +++++ .../TabInStageView/Models/TabInfoAction.cs | 12 ++++++++++++ .../Views/Home/SampleTab.cshtml | 17 +++++++++++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/samples/bot-all-cards/csharp/demo-manifest/bot-all-cards.zip b/samples/bot-all-cards/csharp/demo-manifest/bot-all-cards.zip index 7b975f57d4d44437cbd8626a658c6ae6564393b7..63e6d69832728086f78491f5e854028f8388b8de 100644 GIT binary patch delta 137 zcmeBH?oj3n@MdNaVPIh3U|=g~j@Zb@%F8i58bTGzl@OuWZ2~E0>-F@O%@l_ za|S8;V#IN^9%wuWa|3OM00khW#LvKxUs{rrnU|_pke43d&B_LnWCp_3K>Cybhz9_l C>@nv6 diff --git a/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs b/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs index 667cf0e2d1..774c3f7a4f 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs +++ b/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs @@ -45,6 +45,11 @@ public ActivityBot(IConfiguration configuration) protected override async Task OnMembersAddedAsync(IList membersAdded, ITurnContext turnContext, CancellationToken cancellationToken) { var welcomeText = "Hello and welcome!, Please type any bot command to see the stage view feature"; + + // Set thread Id + TabInfoAction objTabInfo = new TabInfoAction(); + objTabInfo.ThreadId = turnContext.Activity.Conversation.Id; + foreach (var member in membersAdded) { if (member.Id != turnContext.Activity.Recipient.Id) diff --git a/samples/tab-stage-view/csharp/TabInStageView/Models/TabInfoAction.cs b/samples/tab-stage-view/csharp/TabInStageView/Models/TabInfoAction.cs index 514b28ee4b..13e5b30d2a 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Models/TabInfoAction.cs +++ b/samples/tab-stage-view/csharp/TabInStageView/Models/TabInfoAction.cs @@ -5,6 +5,7 @@ namespace TabInStageView.Models { using Newtonsoft.Json; + using System; /// /// Tab info action model class. @@ -22,5 +23,16 @@ public class TabInfoAction /// [JsonProperty("tabInfo")] public TabInfo TabInfo { get; set; } + + /// + /// Gets or sets tab info. + /// + [JsonProperty("threadId")] + public string? ThreadId { get; set; } = string.Empty; + + public TabInfoAction() + { + ThreadId = ""; + } } } \ No newline at end of file diff --git a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml index 4575183cbc..588d2f644f 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml +++ b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml @@ -1,4 +1,7 @@ - +@page +@model TabInStageView.Models.TabInfoAction + + @@ -7,12 +10,19 @@ crossorigin="anonymous"> From 4f23568cf5cbb2bb1080aa169562ae2f5cef0d68 Mon Sep 17 00:00:00 2001 From: Mohammed Furquan Date: Thu, 4 Apr 2024 14:48:08 +0530 Subject: [PATCH 4/5] updated thread comment --- .../tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs | 4 ++-- .../csharp/TabInStageView/Views/Home/SampleTab.cshtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs b/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs index 774c3f7a4f..58086fb94f 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs +++ b/samples/tab-stage-view/csharp/TabInStageView/Bots/ActivityBot.cs @@ -24,6 +24,7 @@ public class ActivityBot : TeamsActivityHandler { private readonly string _appId; private readonly string _applicationBaseURL; + public static string _threadId; /// /// Initializes a new instance of the class. @@ -47,8 +48,7 @@ protected override async Task OnMembersAddedAsync(IList membersA var welcomeText = "Hello and welcome!, Please type any bot command to see the stage view feature"; // Set thread Id - TabInfoAction objTabInfo = new TabInfoAction(); - objTabInfo.ThreadId = turnContext.Activity.Conversation.Id; + _threadId = turnContext.Activity.Conversation.Id; foreach (var member in membersAdded) { diff --git a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml index 588d2f644f..3f814a8a6d 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml +++ b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml @@ -20,8 +20,8 @@ // Client id var appId = '@(ViewBag.AppId)'; - // Get thread id like "19:be817b823c204cde8aa174ae146251dd@thread.v2"; - var threadId = @Model.ThreadId; + // Get thread id by this format "19:***********@thread.v2"; + var threadId = "@TabInStageView.Bots.ActivityBot._threadId"; // Application base url and this redirects to Index view var contentUrl = window.location.origin; From 3af1b134e3f5367f69eac894817c24e79294933b Mon Sep 17 00:00:00 2001 From: Mohammed Furquan Date: Thu, 4 Apr 2024 15:05:13 +0530 Subject: [PATCH 5/5] microsoftTeams.app.initialize(); updated --- .../csharp/TabInStageView/Views/Home/SampleTab.cshtml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml index 3f814a8a6d..01992bbdcc 100644 --- a/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml +++ b/samples/tab-stage-view/csharp/TabInStageView/Views/Home/SampleTab.cshtml @@ -10,17 +10,15 @@ crossorigin="anonymous">