Service | Microsoft Docs article | Related commit history on GitHub | Change details |
---|---|---|---|
platform | App Caching For Your Tab App | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/apps-in-teams-meetings/app-caching-for-your-tab-app.md | - Title: Enable app caching for your tab app- -description: Learn how to enable app caching to your tab app in Teams meeting and how it improves the launch time of the app. -- Previously updated : 04/07/2022---# Enable app caching for your tab app --> [!NOTE] -> App caching is available only in [public developer preview](~/resources/dev-preview/developer-preview-intro.md). --You can configure your tab app (app) to enable app caching to reduce the reload time of your app during a meeting. You can store your app data in the meeting by enabling app caching. The app reloads from the cache, which improves the app relaunch time within the meeting. App caching is supported only for tabs loaded in the meeting side panel in Teams desktop client. --Here's what you'll learn in this section: --1. App caching user experience -1. App caching at runtime -1. Enable app caching --## App caching user experience --App caching improves subsequent launch time of the apps that are loaded in the meeting side panel. Consider the following use case for app caching: --Your app is enabled to be installed in a Teams meeting. The meeting organizer or participants can install and use your app. -- :::column span=""::: - :::image type="content" source="../assets/images/app-caching/without-app-caching.png" alt-text="The screenshot shows you the app in meeting without app caching enabled." lightbox="../assets/images/app-caching/without-app-caching.png"::: - :::column-end::: - :::column span=""::: - During the meeting, the participants may change the view from your app to another view on the meeting stage. When they want to open your app again, the app must go through the launch process again before it can be opened in the meeting window. This takes up time in the meeting as participants are kept waiting while the app reloads. - :::column-end::: - :::column span=""::: - :::image type="content" source="../assets/images/app-caching/with-app-caching.png" alt-text="The Screenshot shows you the app in meeting with app caching enabled." lightbox="../assets/images/app-caching/with-app-caching.png"::: - :::column-end::: - :::column span=""::: - With **app caching**, you can now reduce the reload time significantly. An app cache is a data storage layer that stores your app data in the meeting side panel. When the participants move away from the app and come back to it, the app is loaded from the app cache rather than being relaunched. It enhances the meeting experience of the participants, saves time and resources. - :::column-end::: --## App caching at runtime --When you enable app caching in your app, you can add it to a meeting and the app opens in a webview. The app data is stored in the meeting side panel. If the participants move away from the app within the meeting window, the webview that is used to host the embedded app is reused. The webview that hosts the app is hidden when the participants move away from the app and shown when they come back to the app. At this time, the app is reloaded from the cache. --This process consists of two stages for an app that is enabled for app caching: --1. [First launch of the app](#first-launch-of-the-app) -1. [Reload app from cache](#reload-app-from-cache) --### First launch of the app --The following flow diagram shows how the app loads for the first time it's launched in the meeting. The app registers the `load` or `beforeUnload`: ---| # | Interaction | What's going on | -| | | | -| 1. | Teams client → App | Teams client launches the app to the meeting side panel. | -| 2. | App → Teams client | The app initializes the flow. | -| 3. | App → Teams client | The app registers `Load` or `beforeUnload` handler with Teams clients and caches the app data in the meeting side panel. | -| 4. | App → Teams client | The app invokes SDK `notifySuccess` to notify Teams client that the initialization flow is complete. | -| 5. | Teams client → App | When the participants move away from the app, Teams client disposes resources and performs any cleanup needed in the `beforeUnload` handler. | -| 6. | App → Teams client | The app invokes the `readyToUnload` callback to notify Teams client that the app unload flow is complete. | --### Reload app from cache --The following flow diagram shows how a cached app is reloaded: ---| # | Interaction | What's going on | -| | | | -| 1. | Teams client → App | Teams client loads the app and invokes `Load` callback. | -| 2. | App → Teams client | The app uses `contentUrl` and `entityId` to route to the desired page, and then invokes SDK `notifySuccess` to notify Teams client that the initialization flow is complete. | -| 3. | Teams client → App | When the participants move away from the app, Teams client disposes resources and performs any cleanup needed in the `beforeUnload` handler. | -| 4. | App → Teams client | The app invokes the `readyToUnload` callback to notify Teams client that the app unload flow is complete. | --## Enable app caching --Before you enable app caching for your app, you must [enable your app for Teams meeting](build-tabs-for-meeting.md). --To enable app caching for your app, follow the steps: --1. In the `configure.jsx` file (or the equivalent file in your app), pass `contentUrl` and `entityId` into the load handler to route to the correct page within your app. It also invokes `notifySuccess` or `notifyFailure` to notify Teams client when the app initialization flow is complete. -- * [contentUrl](../tabs/how-to/create-tab-pages/configuration-page.md#modify-or-remove-a-tab): Add content page URL. - * [entityId](../tabs/how-to/create-tab-pages/configuration-page.md#modify-or-remove-a-tab): Add a unique identifier. --1. In the `app-cache-tab.tsx` file (or the equivalent file in your app), configure the following: -- * Call `teamsCore.registerBeforeUnloadHandler` and `teamsCore.registerOnLoadHandler` APIs. - * Dispose resources and perform any cleanup needed in the `beforeUnload` handler. - * Invoke the `readyToUnload` callback to notify Teams client that the app unload flow is complete. --# [TeamsJS v2](#tab/teamsjs-v2) --[Sample code reference](https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/app-cache-meetings/nodejs/src/components/app-cache-tab.tsx#L73) --The following code snippet is an example of the `teamsCore.registerBeforeUnloadHandler` and `teamsCore.registerOnLoadHandler` handlers: --```javascript -microsoftTeams.teamsCore.registerBeforeUnloadHandler((readyToUnload) => { - console.log("got beforeunload from TEAMS");  - // dispose resources and then invoke readyToUnload - readyToUnload(); - return true; -}); -microsoftTeams.teamsCore.registerOnLoadHandler((data) => { - console.log("got load from TEAMS", data.contentUrl, data.entityId); - // use contentUrl to route to correct page - // invoke notifySuccess when ready - app.notifySuccess(); -}); --``` --# [TeamsJS v1](#tab/teamsjs-v1) --The following code snippet is an example of the `registerBeforeUnloadHandler` and `registerOnLoadHandler` handlers: --```javascript -microsoftTeams.registerBeforeUnloadHandler((readyToUnload) => {  - console.log("got beforeunload from TEAMS");  - // dispose resources and then invoke readyToUnload  - readyToUnload();  - return true;  -}); -microsoftTeams.registerOnLoadHandler((data) => {  - console.log("got load from TEAMS", data.contentUrl, data.entityId);  - // use contentUrl to route to correct page  - // invoke notifySuccess when ready  - microsoftTeams.appInitialization.notifySuccess();  -});  --``` ----## Best practices --* Single-page apps that use client-side routing for page navigation can benefit from app caching. It's recommended that you use the same domain across all contexts of your app launch. --* Register the `load` and `beforeUnload` handlers early in your launch sequence. If the handlers aren't registered with the Teams client before the participants move away from the app, the app isn't cached. --* To enable app caching support in Teams meetings, register the `load` or `beforeUnload` handlers only if the context is `sidePanel`. --* Register only the `beforeUnload` handler if your app doesn't require app caching but needs time to safely save state (as leaving the app can cause the app content to be abruptly removed from the Document Object Model (DOM)). If the app hasn't registered for the `load` event, it's removed from the DOM after the unload flow completes. --## Limitations --* App caching is disabled if the system memory is less than 4 GB or if the available memory is less than 1 GB on Windows or 512 MB on Mac. --* App caching isn't supported for meetings where the invited participant count is more than 20. --* When the app is cached, any audio that is playing within the cached app is muted. --* Apps need to re-register for events in the load handler, such as `themeChange`, `focusEnter`, and so on. Teams client won't send any notifications to the app when it's cached. If your app requires notifications even when cached, caching might not be the right solution. --* App caching is supported only in Teams desktop client. In Teams web client, even if the app registers load handlers, the app is removed from the cache after the unload sequence is completed. --* The Teams client invokes the `loadHandler` only after the `unload` sequence of the app is completed. For example, if a participant launches tab A of your app and then launches tab B of the same app, tab B won't get the `Load` callback for caching until tab A invokes the `readyToUnload` callback. --* Apps are cached on a per-window basis. An app cached in a meeting window can't be reused in a channel in the Teams client. --* App caching happens on a per app (not on a per tab) basis within the same meeting window. The same meeting webview gets reused as participants launch your app from various contexts (such as channels, chat, personal app). --* App caching isn't supported for the meeting stage or task module contexts because these can be opened on top of the app. The same webview can't be used to render the content in the tab and the task module. --* The `sidePanel` is the only supported `FrameContext` for app caching. --* Apps are expected to sleep when cached (use minimal compute or network resources and minimizes SDK requests). All the register handlers and the following SDK requests are allowed when the app is cached: -- * `initialize` - * `notifyAppLoaded` - * `notifySuccess` - * `notifyFailure` - * `notifyExpectedFailure` - * `getContext` - * `getAuthToken` - * `readyToUnload` - * `getConfig` or `getSettings` --* The app isn't cached if Teams client doesn't receive the `readyToUnload` callback from the app within 30 seconds after sending the `beforeUnload` notification. --## Troubleshooting --**Why isn't my app getting cached?** --Apps aren't cached if the load handler isn't invoked on subsequent navigation. To resolve this issue, ensure the following: --* App caching requires minimum of 4 GB system memory. Ensure there's sufficient system memory for app caching. --* Reduce your memory footprint by using the `beforeUnload` handlers to dispose resources that aren't needed when your app is cached. --**Why are apps removed from cache?** --* If the system memory load is high, the app is removed from the cache. Ensure that your system memory load isn't high. --* If the participant doesn't come back to the app within 20 minutes, the app is removed from the cache. --* If the number of cached apps exceed the maximum cache size, the oldest cached app is removed from the cache. Ensure you don't exceed the maximum cache size. --## Code sample --|Sample name | Description | Node.js | -|-|--|-| -| App caching in meeting | Sample app to show how app caching works for tab app in Teams meeting. | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/app-cache-meetings/nodejs) | --## See also --* [Build tabs for meeting](build-tabs-for-meeting.md) -* [Build tabs for Teams](../tabs/what-are-tabs.md) |
platform | Build Tabs For Meeting | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/apps-in-teams-meetings/build-tabs-for-meeting.md | Title: Build tabs for meeting -description: Learn how to build a tab for a meeting chat, meeting side panel, and meeting stage in Microsoft Teams meeting. +description: Learn how to build a tab for a meeting chat, meeting side panel, and meeting stage in Microsoft Teams meeting, and app caching in meeting. ms.localizationpriority: high The following table provides the user types and lists the features that each use | Federated or External | Can interact only | Not available | Not available | Can interact only | | Anonymous | Can interact only | Not available | Not available | Not available | +## App caching ++App caching improves subsequent launch time of the apps that are loaded in the meeting side panel by allowing you to keep some resources and assets in memory that you can use when rehydrating app. ++> [!NOTE] +> +> * App caching is available only in [public developer preview](~/resources/dev-preview/developer-preview-intro.md). +> * App caching is supported only for tabs loaded in the meeting side panel in Teams desktop client. While it can work in other contexts such as personal apps and chat or channel tabs, it isn't officially supported. We recommend to register the `onLoad` or `beforeUnload` handlers when in the sidePanel frameContext. ++### Enable app caching ++To enable app caching in your meeting side panel, follow the steps: ++1. Call `teamsCore.registerBeforeUnloadHandler` and `teamsCore.registerOnLoadHandler` APIs. ++1. Use `contentUrl` and `entityId` passed into the load handler to route to the correct page within your app and invoke `notifySuccess` or `notifyFailure` to notify Teams client that the app initialization flow is complete. ++ * [contentUrl](../tabs/how-to/create-tab-pages/configuration-page.md#modify-or-remove-a-tab): Add content page URL. + * [entityId](../tabs/how-to/create-tab-pages/configuration-page.md#modify-or-remove-a-tab): Add a unique identifier. ++1. Dispose resources and perform any cleanup needed in the `beforeUnload` handler, then invoke the `readyToUnload` callback to notify Teams client that the app unload flow is complete. ++The following is the flow diagram of the first launch of an app that wants to opt into app caching (register the `load` or `beforeUnload` on the first launch of the app): +++The following is the flow diagram of the launch of cached app: +++When you opt into app caching, the webview that is used to host the embedded app is reused as users navigate to different instances of the app within a window. The webview used to host the app is hidden when the users leave the app and shown when the users return to the app. When the app is cached, any audio that is playing is muted. ++> [!NOTE] +> If the app caching isn't enabled, the webview is recreated every time the user launches the app. ++There are multiple reasons for an app to not get cached or for an app to get removed from the cache, some of the reasons are (numbers here are subject to change): ++* If the system memory load is high, the app is removed from the cache. +* If the number of cached apps exceed the maximum cache size, the oldest cached app is removed from the cache. +* If the user doesn't return to the app within 20 minutes, the app is removed from the cache. +* The app isn't cached if Teams doesn't receive the `readyToUnload` signal from the app within 30 seconds after sending the `beforeUnload` notification. +* App caching is disabled if the system memory is less than 4 GB or if the available memory is less than 1 GB on Windows or 512 MB on Mac. +* Side panel is the only supported frameContext for app caching in meetings. +* App caching isn't supported for meetings where the invited user count is more than 20. +* If an app fails to load, the app isn't cached. ++### Code example ++The following code snippet is an example of `teamsCore.registerOnLoadHandler` and `teamsCore.registerBeforeUnloadHandler` APIs: ++```javascript +microsoftTeams.teamsCore.registerOnLoadHandler((data) => { + console.log("got load from TEAMS", data.contentUrl, data.entityId); + // use contentUrl to route to correct page + // invoke notifySuccess when ready + app.notifySuccess(); +}); +microsoftTeams.teamsCore.registerBeforeUnloadHandler((readyToUnload) => { + // dispose resources and then invoke readyToUnload + readyToUnload(); + return true; +}); +``` ++### Limitations ++The following are the limitations for app caching: ++* Single-page apps that use client-side routing for page navigation can benefit from app caching. It's recommended that the same domain be used across all contexts of your app launch. ++* Apps need to re-register for events such as `themeChange`, `focusEnter`, and so on, in the load handler. Teams client won't send any notifications to the app when cached. If your app requires notifications even when cached, caching might not be the right solution. ++* App caching is supported only in Teams desktop client. In Teams web client, even if the app registers load handlers, the app is removed from the cache after the unload sequence is completed. ++* Register the `load` and `beforeUnload` handlers early in your launch sequence. If the Teams client doesnΓÇÖt see these registrations before the user leaves the app, the app isn't cached. ++* The Teams client invokes the `loadHandler` only after the `unload` sequence of the app is completed. For example, if a user launches tab A of your app and then launches tab B of the same app, tab B won't get the load signal until the tab A invokes the `readyToUnload` callback. ++* Apps are cached on a per-window basis. App caching happens on a per app (not on a per tab) basis within the same window. ++* App caching isn't supported for the meeting stage or Task module contexts, because these can be opened on top of the tab and the same webview can't be used to render the content in the tab and the Task module. ++* Register only the `beforeUnload` handler if your app doesn't require app caching but needs time to safely save state (as leaving the app can cause the app content to be abruptly removed from the Document Object Model (DOM)). If the app hasn't registered for the `load` event, it's removed from the DOM after the unload flow completes. ++* Follow the guidelines in this section to onboard your app to app caching in Teams meeting. For app caching support only in meetings, register the `load` or `beforeUnload` handlers if the context is `sidePanel`. ++* Apps are expected to sleep when cached (use minimal compute or network resources and minimizes SDK requests). All the register handlers and the following SDK requests are allowed when the app is cached: ++ * `initialize` + * `notifyappLoaded` + * `notifySuccess` + * `notifyFailure` + * `notifyExpectedFailure` + * `getContext` + * `getAuthToken` + * `readyToUnload` + * `getConfig/getSettings` ++### Troubleshooting ++**Apps are not being cached? Why is load handler not invoked on subsequent navigation?** ++* Verify if the system and available memory constraints are met. ++* Reduce your memory footprint when cached. Use the `beforeUnload` handler to dispose resources, for example, release references and remove event listeners, that might not be needed when cached. + ## Code sample |Sample name | Description | .NET | Node.js | Manifest| The following table provides the user types and lists the features that each use * Follow the [step-by-step guide](../sbs-meetings-stage-view.yml) to share meeting stage view in your Teams meeting. * Follow the [step-by-step guide](../sbs-meeting-content-bubble.yml) to generate in-meeting notification in your Teams meeting. -## Next step --> [!div class="nextstepaction"] -> [Enable app caching for your tab app](app-caching-for-your-tab-app.md) - ## See also * [Apps for Teams meetings and calls](teams-apps-in-meetings.md) |
platform | Teams Apps In Meetings | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/apps-in-teams-meetings/teams-apps-in-meetings.md | Meetings enable collaboration, partnership, informed communication, and shared f You can create scenes for meetings, provide notifications to users, populate in-meeting dialogs, and much more with meeting app extensibility. -Third-party and line-of-business apps built for meetings and calls are available in Government Community Cloud (GCC) but aren't available for GCC-High and Department of Defense (DOD) tenants. +Third-party and line-of-business apps built for meetings and calls are available in Government Community Cloud (GCC) but aren't available for GCC-High and Department of Defense (DOD) tenants. You must be familiar with the concepts in this article to create custom meeting experiences with apps in Microsoft Teams. Learn more about [Teams meetings, expiration, and policies](/microsoftteams/meet > [!NOTE] > > Apps aren't supported in the following:-> * [Public Switched Telephone Network (PSTN) Teams calls](/microsoftteams/cloud-voice-landing-page#public-switched-telephone-network-connectivity-options) -> * [End-to-end encrypted Teams calls](https://support.microsoft.com/office/use-end-to-end-encryption-for-teams-calls-1274b4d2-b5c5-4b24-a376-606fa6728a90) -> * [Instant channel meetings](https://support.microsoft.com/office/start-an-instant-meeting-in-teams-ff95e53f-8231-4739-87fa-00b9723f4ef5) -> * Meetings in [shared channel](https://support.microsoft.com/office/what-is-a-shared-channel-in-teams-e70a8c22-fee4-4d6e-986f-9e0781d7d11d) +> +> * [Public Switched Telephone Network (PSTN) Teams calls](/microsoftteams/cloud-voice-landing-page#public-switched-telephone-network-connectivity-options) +> * [End-to-end encrypted Teams calls](https://support.microsoft.com/office/use-end-to-end-encryption-for-teams-calls-1274b4d2-b5c5-4b24-a376-606fa6728a90) +> * [Instant channel meetings](https://support.microsoft.com/office/start-an-instant-meeting-in-teams-ff95e53f-8231-4739-87fa-00b9723f4ef5) +> * Meetings in [shared channel](https://support.microsoft.com/office/what-is-a-shared-channel-in-teams-e70a8c22-fee4-4d6e-986f-9e0781d7d11d) ## Meeting lifecycle A meeting lifecycle includes pre-meeting, in-meeting, and post-meeting app exper ### App caching for tab app in Teams meeting -You can configure your tab app to enable app caching to reduce the reload time of your app during a meeting. The app reloads from the cache, which improves the app relaunch time within the meeting. For more information, see [enable app caching for your tab app](app-caching-for-your-tab-app.md). +You can configure your tab app to enable app caching to reduce the reload time of your app during a meeting. The app reloads from the cache, which improves the app relaunch time within the meeting. For more information, see [enable app caching for your tab app](build-tabs-for-meeting.md#app-caching). ## User types in Teams |
platform | Bot Sso Code | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/authentication/bot-sso-code.md | To update your app's code: 1. Add code snippet for `TeamsSSOTokenExchangeMiddleware`. - # [csharp](#tab/cs1) + # [C#](#tab/cs1) Add the following code snippet to `AdapterWithErrorHandler.cs` (or the equivalent class in your app's code): To update your app's code: 1. Use the following code snippet for requesting a token. - # [csharp](#tab/cs2) + # [C#](#tab/cs2) After you add the `AdapterWithErrorHandler.cs`, your code should be as shown below: The response with the token is sent through an invoke activity with the same sch Use the following code snippet to invoke response: -# [csharp](#tab/cs3) +# [C#](#tab/cs3) ```csharp public MainDialog(IConfiguration configuration, ILogger<MainDialog> logger) The following is a typical decoded payload of an access token. Use the following code snippet to handle the access token in case the app user logs out: -# [csharp](#tab/cs4) +# [C#](#tab/cs4) ```csharp private async Task<DialogTurnResult> InterruptAsync(DialogContext innerDc, |
platform | Channel Messages With Rsc | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/conversations/channel-messages-with-rsc.md | protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivi Services that need access to all Teams message data must use the Graph APIs that provide access to archived data in channels and chats. Bots must use the `ChannelMessage.Read.Group` and `ChatMessage.Read.Chat` RSC permission appropriately to build and enhance engaging experience for users to pass the store approval. The app description must include how the bot uses the data it reads: * The `ChannelMessage.Read.Group` and `ChatMessage.Read.Chat` RSC permission may not be used by bots to extract large amounts of customer data.-* The ability for bots to receive all messages in chats using `ChatMessage.Read.Chat` is available only in [public developer preview for Teams](../../../resources/dev-preview/developer-preview-intro.md) and is only enabled after a re-installation or new installation into a chat. -* After the RSC permissions are enabled, the bot continues to receive all messages even when the client switches out of public developer preview. +* The ability for bots to receive all messages in chats using `ChatMessage.Read.Chat` is only enabled after a re-installation or new installation into a chat. * If you have an app that's using the `ChatMessage.Read.Chat` RSC permission for Graph scenarios, then test the app following the steps in [sideload in a conversation](channel-messages-with-rsc.md?tabs=chat%2Cdotnet#sideload-in-a-conversation) and modify the app before the feature is [generally available](https://www.microsoft.com/en-us/microsoft-365/roadmap?filters=&searchterms=receive%2Call%2Cgroup%2Cchat%2Cmessages). If you don't want your bot to receive all chat messages, implement the following [code snippet](#filtering-at-mention-messages). If no action is taken, your bot will receive all messages after new installations. ## Update app manifest The following steps guide you to sideload and validate bot that receives all cha # [Chat messages](#tab/chat) -The following steps guide you to sideload and validate bot that receives all chat messages in [public developer preview](../../../resources/dev-preview/developer-preview-intro.md) without being @mentioned in a chat: +The following steps guide you to sideload and validate bot that receives all chat messages in a chat without being @mentioned: -1. Switch the client to public developer preview (select **About** > **Developer preview**). 1. Select or create a group chat. 1. Select the ellipses ●●● from the group chat. The dropdown menu appears. 1. Select **Manage apps** from the dropdown menu. |
platform | Msgex Sso Code | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/includes/messaging-extensions/msgex-sso-code.md | To update your app's code: 1. Add code snippet for `TeamsSSOTokenExchangeMiddleware`. - # [csharp](#tab/cs1) + # [C#](#tab/cs1) Add the following code snippet to `AdapterWithErrorHandler.cs` (or the equivalent class in your app's code): To update your app's code: base.Use(new TeamsSSOTokenExchangeMiddleware(storage, configuration["ConnectionName"])); ``` - # [JavaScript](#tab/js1) + # [JavaScript](#tab/js1) Add the following code snippet to `index.js` (or the equivalent class in your app's code): To update your app's code: 1. Use the following code snippet for requesting a token. - # [csharp](#tab/cs2) + # [C#](#tab/cs2) After you add the `AdapterWithErrorHandler.cs`, your code should be as shown below: sign in/tokenExchange, and the **value** field. The **value** field contains the Use the following code snippet example to invoke response: -# [csharp](#tab/cs3) + # [C#](#tab/cs3) ```csharp public MainDialog(IConfiguration configuration, ILogger<MainDialog> logger) private async Task<DialogTurnResult> LoginStepAsync(WaterfallStepContext stepCon } ``` -# [JavaScript](#tab/js3) + # [JavaScript](#tab/js3) ```JavaScript class MainDailog { If you're using the OAuth connection, you must update or add the token in the Bo > [!NOTE] > You can find the sample `TeamsMessagingExtensionsSearchAuthConfigBot.cs` in [Tab, Bot, and Message Extension (ME) SSO](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/app-sso/csharp/App%20SSO%20Sample/Bots). -```c# + # [C#](#tab/cs4) ++```csharp protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext<IInvokeActivity> turnContext, CancellationToken cancellationToken) { JObject valueObject = JObject.FromObject(turnContext.Activity.Value); protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext } ``` + # [JavaScript](#tab/js4) ++```JavaScript ++async onInvokeActivity(context) { + console.log('onInvoke, ' + context.activity.name); + const valueObj = context.activity.value; + if (valueObj.authentication) { + const authObj = valueObj.authentication; + if (authObj.token) { + // If the token is NOT exchangeable, then do NOT deduplicate requests. + if (await this.tokenIsExchangeable(context)) { + return await super.onInvokeActivity(context); + } else { + const response = { + status: 412 + }; + return response; + } + } + } + return await super.onInvokeActivity(context); +} ++async tokenIsExchangeable(context) { + let tokenExchangeResponse = null; + try { + const valueObj = context.activity.value; + const tokenExchangeRequest = valueObj.authentication; + tokenExchangeResponse = await context.adapter.exchangeToken(context, + process.env.connectionName, + context.activity.from.id, + { token: tokenExchangeRequest.token }); + } catch (err) { + console.log('tokenExchange error: ' + err); + // Ignore Exceptions + // If token exchange failed for any reason, tokenExchangeResponse above stays null , and hence we send back a failure invoke response to the caller. + } + if (!tokenExchangeResponse || !tokenExchangeResponse.token) { + return false; + } + return true; +} +``` +++ ## Handle app user log out Use the following code snippet to handle the access token in case the app user logs out: -# [csharp](#tab/cs4) + # [C#](#tab/cs5) ```csharp private async Task<DialogTurnResult> InterruptAsync(DialogContext innerDc, Use the following code snippet to handle the access token in case the app user l } ``` -# [JavaScript](#tab/js4) + # [JavaScript](#tab/js5) ```JavaScript async interrupt(innerDc) { |
platform | Extend M365 Teams Message Extension | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/m365-apps/extend-m365-teams-message-extension.md | To complete this tutorial, you need: ## Link unfurling -If your search-based message extension supports [link unfurling](../messaging-extensions/how-to/link-unfurling.md) in Teams, completing the steps of this tutorial also enables link unfurling in Outlook on the web and Windows desktop environments. The [Code samples](#code-sample) section below provides a simple link unfurling app for testing. +If your search-based message extension supports [link unfurling](../messaging-extensions/how-to/link-unfurling.md) in Teams, follow the steps in this article to enable link unfurling in Outlook on web (Targeted release) and Windows desktop (Beta Channel) environments. The [Code sample](#code-sample) section provides a link unfurling app for testing. ++## Stage view ++If your search-based message extension unfurls links that display cards to launch [stage view](../tabs/tabs-link-unfurling.md) in Teams, follow the steps in this article that enables your users in Outlook on web (Targeted release) and Windows desktop (Beta Channel) to send links that work the same way in Outlook. ++Outlook mobile users on Android and [Microsoft Outlook beta TestFlight](https://testflight.apple.com/join/AhS6fRDK) iOS rings can now receive and take actions on cards from your apps that were sent to them by users on Outlook on web and Windows desktop. ++The [Code sample](#code-sample) section provides a stage view app for testing. ## Prepare your message extension for the upgrade As you test your message extension, you can identify the source (originating fro ||--|--| | NPM Search Connector | Use Teams Toolkit to build a message extension app. Works in Teams, Outlook. | [View](https://github.com/OfficeDev/TeamsFx-Samples/tree/ga/NPM-search-connector-M365) | | Teams Link Unfurling | Simple Teams app to demonstrate link unfurling. Works in Teams, Outlook. | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/msgext-link-unfurling/nodejs)+| Tab in stage view | Microsoft Teams tab sample app for demonstrating a tab in stage view. Works in Teams, Outlook, Microsoft 365 app. | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/msgext-link-unfurling/nodejs) ## Next step |
platform | Overview | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/m365-apps/overview.md | The Teams app platform continues to evolve and expand holistically into the Micr | Teams app features| App manifest element | Teams support |Outlook support | Microsoft 365 app support | Notes | |--|--|--|--|--|--| | [**Tabs-personal scope**](../tabs/how-to/create-personal-tab.md) |`staticTabs` | Web, Desktop, Mobile | Web (Targeted Release), Desktop (Beta Channel) | Web, Desktop, Mobile (Android)| Channel and group scope not yet supported for Microsoft 365. See [notes](../tabs/how-to/using-teams-client-sdk.md#microsoft-365-support-running-teams-apps-in-office-and-outlook).-| [**Message extensions-search-based**](../messaging-extensions/how-to/search-commands/define-search-command.md)| `composeExtensions` | Web, Desktop, Mobile| Web (Targeted Release), Desktop (Beta Channel)| - |Action-based not yet supported for Microsoft 365. See [notes](extend-m365-teams-message-extension.md#troubleshooting). | -| link unfurling | `composeExtensions.messageHandlers` | Web, Desktop | Web (Targeted Release), Desktop (Beta Channel) | - | See [notes](extend-m365-teams-message-extension.md#link-unfurling) | +| [**Message extensions-search-based**](../messaging-extensions/how-to/search-commands/define-search-command.md)| `composeExtensions` | Web, Desktop, Mobile| Web (Targeted release), Desktop (Beta Channel)| - |Action-based not yet supported for Microsoft 365. See [notes](extend-m365-teams-message-extension.md#troubleshooting). | +| link unfurling (including stage view) | `composeExtensions.messageHandlers` | Web, Desktop | Web (Targeted release), Desktop (Beta Channel) | - | See notes on [link unfurling](extend-m365-teams-message-extension.md#link-unfurling) and [stage view](extend-m365-teams-message-extension.md#stage-view)| | [**Office Add-ins**](/office/dev/add-ins/develop/json-manifest-overview) (preview) | `extensions` | - | Web, Desktop | - | Only available in [devPreview](../resources/schem) manifest version. See [notes](#office-add-ins-preview).| Enrollment to [Microsoft 365 Targeted Release](/microsoft-365/admin/manage/release-options-in-office-365) and [Microsoft 365 Apps update channel](/deployoffice/change-update-channels) requires admin opt-in for the entire organization or selected users. For more information, see [Manage access to Teams apps across Microsoft 365](/microsoftteams/manage-third-party-teams-apps). Update channels are device specific and apply only to installations of Microsoft 365 running on Windows. You can also extend your search-based [Teams message extensions](extend-m365-tea :::image type="content" source="images/outlook-teams-messaging-ext.png" alt-text="The screenshot is an example that shows Message extension running in Outlook and Teams."::: -Link unfurling works in Outlook web and Windows environments the same way it does in Microsoft Teams without any further work than using Teams app manifest version 1.13 or later. +Link unfurling works in Outlook web and Windows environments the same way it does in Microsoft Teams without any further work than using Teams app manifest version 1.13 or later. You can also unfurl links with cards that launch stage view. :::image type="content" source="images/outlook-teams-link-unfurling.png" alt-text="The screenshot is an example that shows Link unfurling running in Outlook and Teams."::: |
platform | Whats New | https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/whats-new.md | Developer preview is a public program that provides early access to unreleased T **2023 January** * ***January 31, 2023***: [Introducing Targeted in-meeting notification for apps in Teams.](apps-in-teams-meetings/in-meeting-notification-for-meeting.md#targeted-in-meeting-notification)-* ***January 30, 2023***: [Enable app caching to improve subsequent launch time of the apps to the meeting side panel.](apps-in-teams-meetings/app-caching-for-your-tab-app.md) +* ***January 30, 2023***: [Enable app caching to improve subsequent launch time of the apps to the meeting side panel.](apps-in-teams-meetings/build-tabs-for-meeting.md#app-caching) :::column-end::: :::row-end::: |