Skip to content

Commit 366fef8

Browse files
authored
Merge pull request #278092 from leejyoon/main
Native Teams Meeting ID and Passcode quickstart
2 parents f021360 + 2bf5e65 commit 366fef8

File tree

4 files changed

+105
-19
lines changed

4 files changed

+105
-19
lines changed

articles/communication-services/quickstarts/voice-video-calling/includes/teams-interop/teams-interop-android.md

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Find the finalized code for this quickstart on [GitHub](https://github.com/Azure
1717

1818
- A working [Communication Services calling Android app](../../getting-started-with-calling.md).
1919
- A [Teams deployment](/deployoffice/teams-install).
20+
- The Minimum Version supported for Teams meeting ID and passcode join API: 2.9.0
2021
- An [access token](../../../identity/access-tokens.md).
2122

2223

@@ -32,19 +33,46 @@ Replace code in activity_main.xml with following snippet. The text box will be u
3233
android:layout_width="match_parent"
3334
android:layout_height="match_parent"
3435
tools:context=".MainActivity">
35-
36-
<EditText
37-
android:id="@+id/teams_meeting_link"
38-
android:layout_width="match_parent"
39-
android:layout_height="wrap_content"
40-
android:ems="10"
41-
android:hint="Teams meeting link"
42-
android:inputType="textUri"
43-
android:layout_marginTop="100dp"
44-
android:layout_marginHorizontal="20dp"
45-
app:layout_constraintEnd_toEndOf="parent"
46-
app:layout_constraintStart_toStartOf="parent"
47-
app:layout_constraintTop_toTopOf="parent" />
36+
37+
<LinearLayout
38+
android:id="@+id/meetingInfoLinearLayout"
39+
android:layout_width="match_parent"
40+
android:layout_height="match_parent"
41+
android:orientation="vertical"
42+
android:layout_marginTop="100dp">
43+
44+
<EditText
45+
android:id="@+id/teams_meeting_link"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
android:ems="10"
49+
android:hint="Teams meeting link"
50+
android:inputType="textUri" />
51+
52+
<TextView
53+
android:layout_width="match_parent"
54+
android:layout_height="wrap_content"
55+
android:text="or"
56+
android:textAlignment="center"
57+
android:layout_marginTop="10dp"/>
58+
59+
<EditText
60+
android:id="@+id/teams_meeting_id"
61+
android:layout_width="match_parent"
62+
android:layout_height="wrap_content"
63+
android:ems="10"
64+
android:hint="Teams meeting id"
65+
android:inputType="textUri" />
66+
67+
<EditText
68+
android:id="@+id/teams_meeting_passcode"
69+
android:layout_width="match_parent"
70+
android:layout_height="wrap_content"
71+
android:ems="10"
72+
android:hint="Teams meeting passcode"
73+
android:inputType="textUri" />
74+
75+
</LinearLayout>
4876

4977
<LinearLayout
5078
android:layout_width="match_parent"
@@ -120,6 +148,8 @@ import com.azure.android.communication.calling.HangUpOptions;
120148
import com.azure.android.communication.calling.JoinCallOptions;
121149
import com.azure.android.communication.common.CommunicationTokenCredential;
122150
import com.azure.android.communication.calling.TeamsMeetingLinkLocator;
151+
// import for meeting id and passcode join
152+
// import com.azure.android.communication.calling.TeamsMeetingIdLocator;
123153

124154
public class MainActivity extends AppCompatActivity {
125155
private static final String[] allPermissions = new String[] { Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_PHONE_STATE };
@@ -159,17 +189,28 @@ public class MainActivity extends AppCompatActivity {
159189
}
160190

161191
EditText calleeIdView = findViewById(R.id.teams_meeting_link);
192+
EditText calleeMeetingId = findViewById(R.id.teams_meeting_id);
193+
EditText calleeMeetingPasscode = findViewById(R.id.teams_meeting_passcode);
162194
String meetingLink = calleeIdView.getText().toString();
195+
String meetingId = calleeMeetingId.getText().toString();
196+
String passcode = calleeMeetingPasscode.getText().toString();
197+
163198
if (meetingLink.isEmpty()) {
164199
Toast.makeText(this, "Please enter Teams meeting link", Toast.LENGTH_SHORT).show();
165200
return;
166201
}
167202

168203
JoinCallOptions options = new JoinCallOptions();
169-
TeamsMeetingLinkLocator teamsMeetingLinkLocator = new TeamsMeetingLinkLocator(meetingLink);
204+
205+
// join with meeting link
206+
TeamsMeetingLinkLocator teamsMeetingLocator = new TeamsMeetingLinkLocator(meetingLink);
207+
208+
// (or) to join with meetingId and passcode use the below code snippet.
209+
//TeamsMeetingIdLocator teamsMeetingIdLocator = new TeamsMeetingIdLocator(meetingId, passcode);
210+
170211
call = agent.join(
171212
getApplicationContext(),
172-
teamsMeetingLinkLocator,
213+
teamsMeetingLocator,
173214
options);
174215
call.addOnStateChangedListener(p -> setCallStatus(call.getState().toString()));
175216
call.addOnIsRecordingActiveChangedListener(p -> setRecordingStatus(call.isRecordingActive()));
@@ -255,6 +296,11 @@ public class MainActivity extends AppCompatActivity {
255296
The Teams meeting link can be retrieved using Graph APIs. This is detailed in [Graph documentation](/graph/api/onlinemeeting-createorget?tabs=http&view=graph-rest-beta&preserve-view=true).
256297
The Communication Services Calling SDK accepts a full Teams meeting link. This link is returned as part of the `onlineMeeting` resource, accessible under the [`joinWebUrl` property](/graph/api/resources/onlinemeeting?view=graph-rest-beta&preserve-view=true). You can also get the required meeting information from the **Join Meeting** URL in the Teams meeting invite itself.
257298

299+
## Get the Teams meeting ID and passcode
300+
* Graph API: Use Graph API to retrieve information about onlineMeeting resource and check the object in property joinMeetingIdSettings.
301+
* Teams: In your Teams application, go to Calendar app and open details of a meeting. Online meetings have meeting ID and passcode in the definition of the meeting.
302+
* Outlook: You can find the meeting ID & passcode in calendar events or in email meeting invites.
303+
258304
## Launch the app and join Teams meeting
259305

260306
The app can now be launched using the "Run App" button on the toolbar (Shift+F10). You should see the following:

articles/communication-services/quickstarts/voice-video-calling/includes/teams-interop/teams-interop-ios.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ import AVFoundation
4444

4545
struct ContentView: View {
4646
@State var meetingLink: String = ""
47+
@State var meetingId: String = ""
48+
@State var meetingPasscode: String = ""
4749
@State var callStatus: String = ""
4850
@State var message: String = ""
4951
@State var recordingStatus: String = ""
@@ -57,6 +59,8 @@ struct ContentView: View {
5759
Form {
5860
Section {
5961
TextField("Teams meeting link", text: $meetingLink)
62+
TextField("Teams meeting id", text: $meetingId)
63+
TextField("Teams meeting passcode", text: $meetingPasscode)
6064
Button(action: joinTeamsMeeting) {
6165
Text("Join Teams Meeting")
6266
}.disabled(callAgent == nil)
@@ -100,8 +104,14 @@ struct ContentView: View {
100104
AVAudioSession.sharedInstance().requestRecordPermission { (granted) in
101105
if granted {
102106
let joinCallOptions = JoinCallOptions()
103-
let teamsMeetingLinkLocator = TeamsMeetingLinkLocator(meetingLink: self.meetingLink)
104-
self.callAgent?.join(with: teamsMeetingLinkLocator, joinCallOptions: joinCallOptions) {(call, error) in
107+
108+
// join with meeting link
109+
let teamsMeetingLocator = TeamsMeetingLinkLocator(meetingLink: self.meetingLink)
110+
111+
// (or) to join with meetingId and passcode use the below code snippet.
112+
// let teamsMeetingLocator = TeamsMeetingIdLocator(with: self.meetingId, passcode: self.meetingPasscode)
113+
114+
self.callAgent?.join(with: teamsMeetingLocator, joinCallOptions: joinCallOptions) {(call, error) in
105115
if (error == nil) {
106116
self.call = call
107117
self.callObserver = CallObserver(self)

articles/communication-services/quickstarts/voice-video-calling/includes/teams-interop/teams-interop-windows.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.service: azure-communication-services
1010

1111
In this quickstart, you'll learn how to join a Teams meeting using the Azure Communication Services Calling SDK for Windows.
1212

13+
## Sample Code
14+
Find the finalized code for this quickstart on GitHub for [UWP](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/Calling) and [WinUI 3](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/CallingWinUI).
15+
1316
## Prerequisites
1417

1518
- A working [Communication Services calling Windows app](../../getting-started-with-calling.md).
1619
- A [Teams deployment](/deployoffice/teams-install).
20+
- The Minimum Version supported for Teams meeting ID and passcode join API: 1.7.0
1721
- An [access token](../../../identity/access-tokens.md).
1822

1923
## Add the Teams UI controls and Enable the Teams UI controls
@@ -39,14 +43,20 @@ Replace code in MainPage.xaml with following snippet. The text box will be used
3943
<RowDefinition Height="60*"/>
4044
<RowDefinition Height="16*"/>
4145
</Grid.RowDefinitions>
42-
<TextBox Grid.Row="1" x:Name="CalleeTextBox" PlaceholderText="Who would you like to call?" TextWrapping="Wrap" VerticalAlignment="Center" Height="30" Margin="10,10,10,10" />
4346

44-
<Grid x:Name="AppTitleBar" Background="LightSeaGreen">
47+
<Grid Grid.Row="0" x:Name="AppTitleBar" Background="LightSeaGreen">
4548
<!-- Width of the padding columns is set in LayoutMetricsChanged handler. -->
4649
<!-- Using padding columns instead of Margin ensures that the background paints the area under the caption control buttons (for transparent buttons). -->
4750
<TextBlock x:Name="QuickstartTitle" Text="Calling Quickstart sample title bar" Style="{StaticResource CaptionTextBlockStyle}" Padding="7,7,0,0"/>
4851
</Grid>
4952

53+
<StackPanel Grid.Row="1">
54+
<TextBox x:Name="CalleeTextBox" PlaceholderText="Who would you like to call?" TextWrapping="Wrap" VerticalAlignment="Center" />
55+
<TextBlock Text="or" Padding="7,7,0,0" />
56+
<TextBox x:Name="CalleeMeetingId" PlaceholderText="Teams Meeting Id" TextWrapping="Wrap" VerticalAlignment="Center" />
57+
<TextBox x:Name="CalleeMeetingPasscode" PlaceholderText="Teams Meeting Passcode" TextWrapping="Wrap" VerticalAlignment="Center" />
58+
</StackPanel>
59+
5060
<Grid Grid.Row="2">
5161
<Grid.RowDefinitions>
5262
<RowDefinition/>
@@ -121,12 +131,18 @@ namespace CallingQuickstart
121131
private async void CallButton_Click(object sender, RoutedEventArgs e)
122132
{
123133
var callString = CalleeTextBox.Text.Trim();
134+
var meetingId = CalleeMeetingId.Text.Trim();
135+
var passcode = CalleeMeetingPasscode.Text.Trim();
124136

137+
// join with meeting link
125138
if (!string.IsNullOrEmpty(callString))
126139
{
127140
call = await JoinTeamsMeetingByLinkAsync(teamsMeetinglink);
128141
}
129142

143+
// (or) to join with meetingId and passcode use the below code snippet.
144+
// call = await JoinTeamsMeetingByMeetingIdAsync(meetingId, passcode);
145+
130146
if (call != null)
131147
{
132148
call.RemoteParticipantsUpdated += OnRemoteParticipantsUpdatedAsync;
@@ -333,6 +349,15 @@ namespace CallingQuickstart
333349
return call;
334350
}
335351

352+
private async Task<CommunicationCall> JoinTeamsMeetingByMeetingIdAsync(String meetingId, String passcode)
353+
{
354+
var joinCallOptions = GetJoinCallOptions();
355+
356+
var teamsMeetingIdLocator = new TeamsMeetingIdLocator(meetingId, passcode);
357+
var call = await callAgent.JoinAsync(teamsMeetingIdLocator, joinCallOptions);
358+
return call;
359+
}
360+
336361
private JoinCallOptions GetJoinCallOptions()
337362
{
338363
return new JoinCallOptions() {
@@ -351,6 +376,11 @@ namespace CallingQuickstart
351376
The Teams meeting link can be retrieved using Graph APIs. This is detailed in [Graph documentation](/graph/api/onlinemeeting-createorget?tabs=http&view=graph-rest-beta&preserve-view=true).
352377
The Communication Services Calling SDK accepts a full Teams meeting link. This link is returned as part of the `onlineMeeting` resource, accessible under the [`joinWebUrl` property](/graph/api/resources/onlinemeeting?view=graph-rest-beta&preserve-view=true). You can also get the required meeting information from the **Join Meeting** URL in the Teams meeting invite itself.
353378

379+
## Get the Teams meeting ID and passcode
380+
* Graph API: Use Graph API to retrieve information about onlineMeeting resource and check the object in property `joinMeetingIdSettings`.
381+
* Teams: In your Teams application, go to Calendar app and open details of a meeting. Online meetings have meeting ID and passcode in the definition of the meeting.
382+
* Outlook: You can find the meeting ID & passcode in calendar events or in email meeting invites.
383+
354384
## Launch the app and join Teams meeting
355385

356386
You can build and run your app on Visual Studio by selecting **Debug** > **Start Debugging** or by using the (F5) keyboard shortcut.
Loading

0 commit comments

Comments
 (0)