TeamsConnector 1.0.3
dotnet add package TeamsConnector --version 1.0.3
NuGet\Install-Package TeamsConnector -Version 1.0.3
<PackageReference Include="TeamsConnector" Version="1.0.3" />
<PackageVersion Include="TeamsConnector" Version="1.0.3" />
<PackageReference Include="TeamsConnector" />
paket add TeamsConnector --version 1.0.3
#r "nuget: TeamsConnector, 1.0.3"
#:package TeamsConnector@1.0.3
#addin nuget:?package=TeamsConnector&version=1.0.3
#tool nuget:?package=TeamsConnector&version=1.0.3
About TeamsConnector
A simple package for interfacing with Microsoft Teams, written in C# and .NET 6.0.
Main features:
- Get presence of current user
- Get notified about presence changes
- Get notified about incoming calls, including the calling phone number
- Make outgoing calls
Works with both the old and new (beta) Teams client!
Getting started
Create a new instance of TeamsClient and get presence of the current user:
var teamsClient = new TeamsClient();
string presence = teamsClient.GetAvailability() + "/" + teamsClient.GetActivity();
Get notified about presence changes:
teamsClient.PresenceChanged += TeamsClient_PresenceChanged;
teamsClient.CreatePresenceSubscription();
private void TeamsClient_PresenceChanged(object? sender, PresenceChangedEventArgs e)
{
Console.WriteLine($"Presence changed: {e.Availability}/{e.Activity}");
}
Get notified about incoming calls:
teamsClient.IncomingCall += TeamsClient_IncomingCall;
private void TeamsClient_IncomingCall(object? sender, IncomingCallEventArgs e)
{
Console.WriteLine($"Incoming call from: {e.PhoneNumber}");
}
Start an outgoing call:
teamsClient.MakeCall("+41441112233");
Error handling
The constructor of the TeamsClient class throws a TeamsConnectorException exception if:
- Microsoft Teams ist not registered as the default IM application
- MIcrosoft Teams is not started
If your program ends or you no longer need your instance of the TeamsClient class, you should remove all event handlers and call the Dispose() method:
teamsClient.PresenceChanged -= TeamsClient_PresenceChanged;
teamsClient.IncomingCall -= TeamsClient_IncomingCall;
teamsClient.Dispose();
How it works
TeamsConnector does not make use of the Graph API, instead it uses UI Automation to interact with the Microsoft Teams window and the Office UC API to get presence information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Interop.UIAutomationClient (>= 10.19041.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.3 | 433 | 4/7/2023 |