0

I am developing a MS Team app which has a Tab and a Notification only Bot.

How can i add a deep link to my tab when the user clicks on the Notification from the Activity Feed.

Sending the notification like below.

const activity = {
                attachments: [card],
                text: 'Notification Text',
                summary: 'Notification Summary',
                channelData: {
                    notification: {
                        alert: true
                    }
                }
            };
            await turnContext.sendActivity(activity);
AhmedVali
  • 185
  • 2
  • 16

1 Answers1

1

The slighly tricky part is figuring out the syntax for the deeplink, it's a little confusing the first time you do it, but have a look at the docs for Create Deep Links. Once you have the link url itself, then you can send it to the user in the notification, as a regular message, or a card (e.g. Adaptive Card) or similar.

Some Deep Link parts that can be tricky:

  1. the "App id" is the TEAMS app id (from your Teams Manifest, or from App Studio), NOT the "Microsoft App Id" from the bot itself
  2. The "entity ID" is the "entity id" you registered for your Tab in the Teams manifest (or in App Studio if you used that)
Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24
  • Hi, I am able to calculate the DeepLink . Modified the question with the snippet to send notification. How should i add a deep link attribute here ? – AhmedVali May 12 '20 at 16:48
  • Are you sending an actual "card" attachment right now? If so, you can add the link in as an element inside there. If you want to it to just appear in the text message from the bot, you need to "markdown" encode the link, like so: instead of "the link is https://stackoverflow.com" you would need to send: "the link is [ https://stackoverflow.com ]( https://stackoverflow.com )" – Hilton Giesenow May 12 '20 at 16:56
  • It's hard to put the markdown syntax in this comments box because StackOverflow actually encodes it as a hyperlink! Do you understand what I mean though, about markdown encoding it? – Hilton Giesenow May 12 '20 at 16:58
  • Thanks Hilton. I got the markdown syntax. Here is the link I found - https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/format-your-bot-messages – AhmedVali May 13 '20 at 21:08