0

I am currently developing an application using Angular 15, and as part of its key functionality, it uses the "@microsoft/teams-js" library (version 2.11.0) to share content via deep links from a private channel to other chats or channels in Microsoft Teams.

In this application, I'm employing the shareWebContent function from the Teams JS library to dispatch the deep link and an accompanying message. This function, according to the official documentation, triggers a share dialog for web content.

However, I'm confronted with an issue: when a user who lacks access to the private channel tries to open the shared deep link from a public channel, there's no response. On the contrary, users who do have access can navigate to the link without a hitch. The problematic part is that users without access do not receive any alert message or notification indicating their lack of access to the content.

Below is the code snippet for the shareWebContent function:

const shareRequest = {
// other properties...
webContent: {
    // other properties...
    url: '<Deep Link>',
}
};

teams.sharing.shareWebContent(shareRequest, (err) => {
    if (err) {
        console.error("Failed to share content", err);
    }
});

My expectation was for the Teams JS library to provide an error message or some form of feedback when a user without access to the private channel tries to open a deep link. Is there a way to manage this scenario?

I would greatly appreciate any insights or suggestions. Thank you!

Vinny P.
  • 21
  • 9
  • Could you please confirm the following? Are you trying to share the content from a public channel to a private channel or vice versa? We tried to share the content from public channel to private channel. When a user searches for private channels, only the channels he is member of are shown in search results. Also could you please let us know what are you passing in url property? We are implementing like this - https://i.stack.imgur.com/gTxLg.png – Meghana-MSFT Jun 29 '23 at 15:23
  • User is sharing a news headline with link from a private channel sharing to a public channel. let msgText = 'Please read this article'; let URL = https://teams.microsoft.com/l/entity/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx?context=%7B%22subEntityId%22%3A%22article%2Fxxxxxxxxx%22%7D;` Content: `content:[ { type: 'URL', url: URL, // Use the deep link here with app id and entity id message: msgText, preview: false } ] ` – Vinny P. Jul 05 '23 at 18:39
  • Console Error. `TypeError: Cannot read properties of undefined (reading 'toLowerCase') at e.getExtensionDefinition (https://statics.teams.cdn.office.net/hashed/3.2-app.min-fdce620.js:1:4440324) at e.getExtensionDefinition (https://statics.teams.cdn.office.net/hashed/3.2-app.min-fdce620.js:1:4872837) at t.setTabExtensionProperties (https://statics.teams.cdn.office.net/hashed/3.1-app.min-ef6bca2.js:1:9929844) at https://statics.teams.cdn.office.net/hashed/3.1-app.min-ef6bca2.js:1:9931184...` – Vinny P. Jul 05 '23 at 19:04

0 Answers0