This sample app illustartes the proactive installation of app using Graph API and sending proactive notification to users from GroupChat or Channel.
Language Used : C#
- Microsoft Teams is installed and you have an account
- .NET Core SDK version 3.1
- ngrok or equivalent tunnelling solution
- Clone the repository
git clone https://github.com/OfficeDev/microsoft-teams-samples.git
- Run the bot from a terminal or from Visual Studio:
- Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to
samples/graph-proactive-installation/csharp
folder - Select
ProactiveAppInstallation.sln
file - Press
F5
to run the project
- Run ngrok to point to port 3978
ngrok http -host-header=rewrite 3978
- Update the manifest.json file with
Microsoft-App-ID
value and to get TeamsAppCatalogId upload your Manifest for my Organization. - Go to appsettings.json and update
MicrosoftAppId
,MicrosoftAppPassword
,TeamsappcatalogAppId
information.- To get
TeamsappcatalogAppId
you first navigate to following link in your browser Get TeamsAppCatalogId from Microsoft Graph explorer. Then search with app name or based on Manifest App id in Graph Explorer response and copy theId
[i.e teamApp.Id]
- To get
- Required Microsoft graph Application level permissions to run this sample app
- TeamsAppInstallation.ReadWriteForUser.All
- Get consent for the Application permissions by following steps mentioned here.
- Run your app, either from Visual Studio with
F5
or usingdotnet run
in the appropriate folder.
-
Install the Proactive App Installation demo in a Team or GroupChat.
-
Team Scope: Run Check and install to pro-actively installs the App for all the users in team. After installation send 'Send message' command to send proactive message.
-
Group Chat: Run Check and install to pro-actively installs the App for all the users in team. After installation send 'Send message' command to send proactive message.