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
At this point, we have set up a static HTML page with a button that opens a call widget when clicked. Next, we add the widget script code. It makes a call to our Azure Function to get the access token and then use it to initialize our call client for Azure Communication Services and start the call to the Teams user we define.
123
123
@@ -134,53 +134,54 @@ Add the following code to the `getAccessToken()` function:
134
134
}
135
135
136
136
```
137
+
137
138
You need to add the URL of your Azure Function. You can find these values in the Azure portal under your Azure Function resource.
138
139
139
140
140
141
## Initialize the call widget
141
142
142
143
1. Add a script tag to load the call widget script:
We provide a test script hosted on GitHub for you to use for testing. For production scenarios, we recommend hosting the script on your own CDN. For more information on how to build your own bundle, see [this article](https://azure.github.io/communication-ui-library/?path=/docs/use-composite-in-non-react-environment--page#build-your-own-composite-js-bundle-files).
151
152
152
-
1. Add the following code under the button event listener:
153
+
2. Add the following code under the button event listener:
locator: { participantIds: ['INSERT USER UNIQUE IDENTIFIER FROM MICROSOFT GRAPH']},
168
+
userId: response.user,
169
+
token: response.userToken
170
+
},
171
+
content,
172
+
{
173
+
formFactor: 'mobile',
174
+
key: new Date()
175
+
}
176
+
);
177
+
} else if (open) {
178
+
open = !open;
179
+
content.style.display = 'none';
180
+
button.innerHTML = '?';
181
+
}
182
+
});
182
183
183
-
```
184
+
```
184
185
185
186
Add a Microsoft Graph [User](https://learn.microsoft.com/graph/api/resources/user?view=graph-rest-1.0) ID to the `participantIds` array. You can find this value through [Microsoft Graph](https://learn.microsoft.com/graph/api/user-get?view=graph-rest-1.0&tabs=http) or through [Microsoft Graph explorer](https://developer.microsoft.com/graph/graph-explorer) for testing purposes. There you can grab the `id` value from the response.
0 commit comments