You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/how-tos/calling-sdk/includes/install-sdk/install-sdk-windows.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,17 @@ ms.author: rifox
9
9
10
10
### Creating the Visual Studio project
11
11
12
-
In Visual Studio 2019, create a new `Blank App (Universal Windows)` project. After entering the project name, feel free to pick any Windows SDK greater than `10.0.17134`.
12
+
For UWP app, in Visual Studio 2019, create a new `Blank App (Universal Windows)` project. After entering the project name, feel free to pick any Windows SDK greater than `10.0.17134`.
13
13
14
+
For WinUI 3 app, create a new project with the `Blank App, Packaged (WinUI 3 in Desktop)` template to set up a single-page WinUI 3 app. [Windows App SDK version 1.2 preview 2](https://learn.microsoft.com/windows/apps/windows-app-sdk/preview-channel#version-12-preview-2-120-preview2) and above is required.
14
15
### Install the package and dependencies with NuGet Package Manager
15
16
16
-
Tha Calling SDK APIs and libraries are publicly available via a NuGet package.
17
+
The Calling SDK APIs and libraries are publicly available via a NuGet package.
17
18
The following steps exemplify how to find, download, and install the Calling SDK NuGet package.
18
19
19
20
1. Open NuGet Package Manager (`Tools` -> `NuGet Package Manager` -> `Manage NuGet Packages for Solution`)
20
21
2. Click on `Browse` and then type `Azure.Communication.Calling` in the search box.
21
22
3. Make sure that `Include prerelease` check box is selected.
22
-
4. Click on the `Azure.Communication.Calling` package.
23
+
4. Click on the `Azure.Communication.Calling` package, select `Azure.Communication.Calling`[1.0.0-beta.33](https://www.nuget.org/packages/Azure.Communication.Calling/1.0.0-beta.33) or newer version.
23
24
5. Select the checkbox corresponding to the CS project on the right-side tab.
<TextBoxx:Name="CalleeTextBox"Text="Who would you like to call?"TextWrapping="Wrap"VerticalAlignment="Center" Grid.Row="0"Height="40"Margin="10,10,10,10" />
The Calling SDK APIs are in two different namespaces.
53
38
The following steps inform the C# compiler about these namespaces allowing Visual Studio's Intellisense to assist with code development.
54
39
55
-
1. In the `Solution Explorer` panel, click on the arrow on the left side of the file named `MainPage.xaml`.
56
-
2. Double click on file named `MainPage.xaml.cs`which showed up.
40
+
1. In the `Solution Explorer` panel, click on the arrow on the left side of the file named `MainPage.xaml` for UWP, or `MainWindows.xaml` for WinUI 3.
41
+
2. Double click on file named `MainPage.xaml.cs`or `MainWindows.xaml.cs`.
57
42
3. Add the following commands at the bottom of the current `using` statements.
58
43
59
44
```csharp
60
45
usingAzure.Communication;
61
46
usingAzure.Communication.Calling;
62
47
```
63
48
64
-
Please keep `MainPage.xaml.cs` open. The next steps will add more code to it.
49
+
Please keep `MainPage.xaml.cs`or `MainWindows.xaml.cs`open. The next steps will add more code to it.
65
50
66
51
## Allow app interactions
67
52
68
-
The UI buttons previously added need to operate on top of a placed `Call`. It means that a `Call` data member should be added to the `MainPage` class.
53
+
The UI buttons previously added need to operate on top of a placed `Call`. It means that a `Call` data member should be added to the `MainPage`or `MainWindow`class.
69
54
Additionally, to allow the asynchronous operation creating `CallAgent` to succeed, a `CallAgent` data member should also be added to the same class.
70
55
71
-
Please add the following data members to the `MainPage` class:
56
+
Please add the following data members to the `MainPage`pr `MainWindow`class:
72
57
```csharp
73
-
CallAgentagent_;
74
-
Callcall_;
58
+
CallAgentcallAgent;
59
+
Callcall;
75
60
```
76
61
77
62
## Create button handlers
@@ -80,12 +65,14 @@ Previously, two UI buttons were added to the XAML code. The following code adds
80
65
The following code should be added after the data members from the previous section.
@@ -108,28 +95,22 @@ To create a `CallAgent` instance from `CallClient` you must use `CallClient.Crea
108
95
109
96
To create `CallAgent`, you must pass a `CommunicationTokenCredential` object and a `CallAgentOptions` object. Keep in mind that `CommunicationTokenCredential` throws if a malformed token is passed.
110
97
111
-
The following code should be added inside `CallHandler`.
98
+
The following code should be added inside and helper function to be called in app initialization.
`<USER ACCESS TOKEN>` must be replaced by a valid credential token for your resource. Refer to the [user access token](../../../../quickstarts/access-tokens.md) documentation if a credential token has to be sourced.
113
+
`<AUTHENTICATION_TOKEN>` must be replaced by a valid credential token for your resource. Refer to the [user access token](../../../../quickstarts/access-tokens.md) documentation if a credential token has to be sourced.
133
114
134
115
## Create CallAgent and place a call
135
116
@@ -138,34 +119,27 @@ The objects needed for creating a `CallAgent` are now ready. It is time to async
138
119
The following code should be added after handling the exception from the previous step.
Replace `<CALLEE>` with any other identity from your tenant. Alternatively, feel free to use `8:echo123` to talk to the Azure Communication Services echo bot.
130
+
Feel free to use `8:echo123` to talk to the Azure Communication Services echo bot.
154
131
155
132
## End a call
156
133
157
-
Once a call is placed, the `Hangup` method of the `Call` object should be used to hang up the call.
134
+
Once a call is placed, the `HangupAsync` method of the `Call` object should be used to hang up the call.
158
135
159
136
An instance of `HangupOptions` should also be used to inform if the call must be terminated to all its participants.
160
137
161
-
The following code should be added inside `HangupHandler`.
138
+
The following code should be added inside `HangupButton_Click`.
0 commit comments