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!