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
titleSuffix: An Azure Communication Services how-to guide
4
-
description: Add calling and chat functionality using the Azure Communication Services UI Library.
4
+
description: Add calling and chat functionality by using the Azure Communication Services UI Library.
5
5
author: pavelprystinka
6
6
7
7
ms.author: pprystinka
@@ -12,12 +12,12 @@ ms.date: 10/28/2024
12
12
ms.custom: template-how-to
13
13
zone_pivot_groups: acs-plat-ios-android
14
14
15
-
#Customer intent: As a developer, I want to add calling and chat functionality to my App.
15
+
#Customer intent: As a developer, I want to add calling and chat functionality to my app.
16
16
---
17
17
18
-
# Integrate Calling and Chat UI Libraries
18
+
# Integrate calling and chat by using the UI Library
19
19
20
-
## Set up the feature
20
+
In this article, you learn how to integrate calling and chat functionality in your Android or iOS app by using the Azure Communication Services UI Library.
21
21
22
22
::: zone pivot="platform-android"
23
23
[!INCLUDE [Integrate Calling with Chat in the Android UI Library](./includes/get-started-calling-with-chat/android.md)]
[!INCLUDE [Integrate Calling with Chat in the iOS UI Library](./includes/get-started-calling-with-chat/ios.md)]
28
28
::: zone-end
29
29
30
-
31
30
## Run the code
32
31
33
-
To build and run your app on the device.
32
+
Run the code to build and run your app on the device.
34
33
35
34
### More features
36
35
37
-
The list of [use cases](../../concepts/ui-library/ui-library-use-cases.md?branch=main&pivots=platform-mobile) has detailed information about more features.
36
+
The [list of use cases](../../concepts/ui-library/ui-library-use-cases.md?branch=main&pivots=platform-mobile) has detailed information about more features.
38
37
39
38
## Add notifications to your mobile app
40
39
41
40
Azure Communication Services integrates with [Azure Event Grid](../../../event-grid/overview.md) and [Azure Notification Hubs](../../../notification-hubs/notification-hubs-push-notification-overview.md), so you can [add push notifications](../../concepts/notifications.md) to your apps in Azure. You can use push notifications to send information from your application to users' mobile devices. A push notification can show a dialog, play a sound, or display an incoming call UI.
42
41
43
-
44
-
## Next steps
42
+
## Related content
45
43
46
44
-[Learn more about the UI Library](../../concepts/ui-library/ui-library-overview.md)
- A deployed [Azure Communication Services resource](../../../create-communication-resource.md).
14
14
- An Azure Communication Services [access token](../../../identity/quick-create-identity.md).
15
15
16
-
## A complete sample
16
+
## Get a complete sample
17
17
18
-
You can get a [complete sample project](https://github.com/Azure-Samples/communication-services-calling-ui-with-chat-android) from the GitHub.
18
+
You can get a [complete sample project](https://github.com/Azure-Samples/communication-services-calling-ui-with-chat-android) from GitHub.
19
19
20
-
:::image type="content" source="../../media/call-chat-android-experience.gif" alt-text="animation to showcase the experience on Android using call and chat in the same app.":::
20
+
:::image type="content" source="../../media/call-chat-android-experience.gif" alt-text="Animation to showcase the experience on Android using call and chat in the same app.":::
21
21
22
22
## Set up the project
23
23
24
-
Complete the following sections to set up the quickstart project.
25
-
26
-
### Create a new Android project
27
-
28
24
In Android Studio, create a new project:
29
25
30
-
1.In the **File** menu, select **New** > **New Project**.
26
+
1.On the **File** menu, select **New** > **New Project**.
31
27
32
28
1. In **New Project**, select the **Empty Activity** project template.
33
29
34
30
:::image type="content" source="../../media/composite-android-new-project.png" alt-text="Screenshot that shows the New Project dialog in Android Studio with Empty Activity selected.":::
35
31
36
32
1. Select **Next**.
37
33
38
-
1. In **Empty Activity**, name the project **UILibraryQuickStart**. For language, select **Java/Kotlin**. For the minimum SDK, select **API 26: Android 8.0 (Oreo)** or later.
34
+
1. In **Empty Activity**, name the project **UILibraryQuickStart**. For language, select **Java** or **Kotlin**. For the minimum SDK, select **API 26: Android 8.0 (Oreo)** or later.
39
35
40
36
1. Select **Finish**.
41
37
42
-
:::image type="content" source="../../media/composite-android-new-project-finish.png" alt-text="Screenshot that shows new project options and the Finish button selected.":::
38
+
:::image type="content" source="../../media/composite-android-new-project-finish.png" alt-text="Screenshot that shows new project options and the Finish button.":::
43
39
44
40
## Install the packages
45
41
46
42
Complete the following sections to install the required application packages.
47
43
48
44
### Add a dependency
49
45
50
-
In your app-level *UILibraryQuickStart/app/build.gradle* file (in the app folder), add the following dependency:
46
+
In your app-level *UILibraryQuickStart/app/build.gradle* file, add the following dependency:
51
47
52
48
```groovy
53
49
dependencies {
@@ -57,7 +53,8 @@ dependencies {
57
53
...
58
54
}
59
55
```
60
-
Add META-INF exclusion to the *UILibraryQuickStart/app/build.gradle*`android` section
56
+
57
+
Add a `META-INF` exclusion to the *UILibraryQuickStart/app/build.gradle*`android` section:
61
58
62
59
```groovy
63
60
packaging {
@@ -67,9 +64,9 @@ packaging {
67
64
68
65
### Add Maven repositories
69
66
70
-
Two Maven repositories are required to integrate the library:
67
+
You need two Maven repositories to integrate the library:
71
68
72
-
-MavenCentral
69
+
-The `mavenCentral` repository
73
70
- The Azure package repository
74
71
75
72
```groovy
@@ -83,15 +80,13 @@ Two Maven repositories are required to integrate the library:
83
80
}
84
81
```
85
82
83
+
## Connect to the Teams meeting with calling and chat
86
84
87
-
## Connect to the Teams Meeting with Calling and Chat
85
+
You use `CallComposite` to connect to the call. After a user is admitted to the call, `CallComposite` notifies you by changing the status to `connected`. Then the user can be connected to the chat thread.
88
86
89
-
- First we will use CallComposite to connect to the call
90
-
- Once user is admitted to the call, CallComposite will notify us by changing status to `connected`
91
-
- Then user can be connected to the chat thread
92
-
- When user clicks `Chat button`, a custom button added to the CallComposite, CallComposite will be minimized and Chat is displayed
87
+
When the user selects the **Chat** button, a custom button is added to `CallComposite`. `CallComposite` is minimized, and **Chat** appears in Teams.
93
88
94
-
## Add button and chat container view to Activity_main.xml
89
+
## Add a button and chat container view to Activity_main.xml
95
90
96
91
In the *app/src/main/res/layout/activity_main.xml* layout file, add the following code to create a button to start the composite:
97
92
@@ -134,27 +129,27 @@ In the *app/src/main/res/layout/activity_main.xml* layout file, add the followin
- Download an icon from [here](https://github.com/microsoft/fluentui-system-icons/blob/master/android/library/src/main/res/drawable/ic_fluent_chat_24_regular.xml).
140
-
- Save it to the *UILibraryQuickStart/app/src/main/res/drawable*
141
-
- Open it and change `android:fillColor` to the `@color/white`
134
+
1. Download an icon from the [GitHub repository](https://github.com/microsoft/fluentui-system-icons/blob/master/android/library/src/main/res/drawable/ic_fluent_chat_24_regular.xml).
135
+
1. Save the icon to *UILibraryQuickStart/app/src/main/res/drawable*.
136
+
1. Open the icon and change `android:fillColor` to `@color/white`.
142
137
143
-
## Initialize the composites
138
+
## Initialize the composite
144
139
145
-
To initialize the Call composite:
140
+
To initialize the call composite, go to `MainActivity` and update connection settings:
146
141
147
-
- Go to `MainActivity` and update connection settings:
148
-
- Replace `TEAM_MEETING_LINK` with the Teams meeting link.
149
-
- Replace `ACS_ENDPOINT` with your ACS resource's endpoint.
150
-
- Replace `DISPLAY_NAME` with your name.
151
-
- Replace `USER_ID` with ACS user ID.
152
-
- Replace `USER_ACCESS_TOKEN` with your token.
142
+
- Replace `TEAM_MEETING_LINK` with the Teams meeting link.
143
+
- Replace `ACS_ENDPOINT` with your Azure Communication Services resource's endpoint.
144
+
- Replace `DISPLAY_NAME` with your name.
145
+
- Replace `USER_ID` with your Azure Communication Services user ID.
146
+
- Replace `USER_ACCESS_TOKEN` with your token.
153
147
154
-
### Get a Teams meeting chat thread for a Communication Services user
155
-
The Teams meeting details can be retrieved using Graph APIs, detailed in [Graph documentation]()(/graph/api/onlinemeeting-createorget). The Communication Services Calling SDK accepts a full Teams meeting link or a meeting ID. They're returned as part of the `onlineMeeting` resource, accessible under the [joinWebUrl](/graph/api/resources/onlineMeeting) property
148
+
### Get a Teams meeting chat thread for an Azure Communication Services user
156
149
157
-
With the Graph APIs, you can also obtain the threadID. The response has a chatInfo object that contains the threadID.
150
+
You can retrieve Teams meeting details by using Graph APIs, as described in the [Graph documentation](/graph/api/onlinemeeting-createorget). The Azure Communication Services Calling SDK accepts a full Teams meeting link or a meeting ID. They're returned as part of the `onlineMeeting` resource, which is accessible under the [joinWebUrl](/graph/api/resources/onlineMeeting) property.
151
+
152
+
With the Graph APIs, you can also obtain the `threadID` value. The response has a `chatInfo` object that contains the `threadID` value.
158
153
159
154
#### [Kotlin](#tab/kotlin)
160
155
@@ -234,8 +229,8 @@ class MainActivity : AppCompatActivity() {
- An Azure account and an active Azure subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
12
-
- A Mac running [Xcode](https://go.microsoft.com/fwLink/p/?LinkID=266532) 13 or later and a valid developer certificate installed in your keychain. [CocoaPods](https://cocoapods.org/) must also be installed to fetch dependencies.
12
+
- A Mac running [Xcode](https://go.microsoft.com/fwLink/p/?LinkID=266532) 13 or later, and a valid developer certificate installed in your keychain. [CocoaPods](https://cocoapods.org/) must also be installed to fetch dependencies.
13
13
- A deployed [Azure Communication Services resource](../../../create-communication-resource.md).
14
14
- An Azure Communication Services [access token](../../../identity/quick-create-identity.md).
15
15
16
-
## A complete sample
16
+
## Get a complete sample
17
17
18
-
You can get a [complete sample project](https://github.com/Azure-Samples/communication-services-calling-ui-with-chat-ios) from the GitHub.
18
+
You can get a [complete sample project](https://github.com/Azure-Samples/communication-services-calling-ui-with-chat-ios) from GitHub.
19
19
20
-
:::image type="content" source="../../media/call-chat-ios-experience.gif" alt-text="animation to showcase the experience on iOS using call and chat in the same app.":::
20
+
:::image type="content" source="../../media/call-chat-ios-experience.gif" alt-text="Animation to showcase the experience on iOS using call and chat in the same app.":::
21
21
22
22
## Set up the project
23
23
@@ -27,7 +27,7 @@ Complete the following sections to set up the quickstart project.
27
27
28
28
In Xcode, create a new project:
29
29
30
-
1.In the **File** menu, select **New** > **Project**.
30
+
1.On the **File** menu, select **New** > **Project**.
31
31
32
32
1. In **Choose a template for your new project**, select the **iOS** platform and select the **App** application template. The quickstart uses the UIKit storyboards. The quickstart doesn't create tests, so you can clear the **Include Tests** checkbox.
33
33
@@ -39,7 +39,7 @@ In Xcode, create a new project:
39
39
40
40
### Install the package and dependencies
41
41
42
-
1. (Optional) For MacBook with M1, install, and enable [Rosetta](https://support.apple.com/HT211861) in Xcode.
42
+
1. (Optional) For MacBook with M1, install and enable [Rosetta](https://support.apple.com/HT211861) in Xcode.
43
43
44
44
1. In your project root directory, run `pod init` to create a Podfile. If you encounter an error, update [CocoaPods](https://guides.cocoapods.org/using/getting-started.html) to the current version.
45
45
@@ -57,13 +57,13 @@ In Xcode, create a new project:
57
57
58
58
1. Run`pod install --repo-update`.
59
59
60
-
1. InXcode, open the generated.xcworkspace* file.
60
+
1. InXcode, open the *generated.xcworkspace* file.
61
61
62
62
### Request access to device hardware
63
63
64
-
To access the device's hardware, including the microphone, and camera, update your app's information property list. Set the associated value to a string that's included in the dialog the system uses to request access from the user.
64
+
To access the device's hardware, including the microphone and camera, update your app's information property list. Set the associated value to a string that's included in the dialog that the system uses to request access from the user.
65
65
66
-
1. Right-click the `Info.plist` entry of the project tree and select **Open As** > **Source Code**. Add the following lines to the toplevel `<dict>` section, and then save the file.
66
+
1. Right-click the `Info.plist` entry of the project tree and select **Open As** > **Source Code**. Add the following lines to the top-level `<dict>` section, and then save the file.
67
67
68
68
```xml
69
69
<key>NSCameraUsageDescription</key>
@@ -74,7 +74,7 @@ To access the device's hardware, including the microphone, and camera, update yo
74
74
75
75
Here's an example of the `Info.plist` source code in an Xcodefile:
76
76
77
-
:::image type="content" source="../../media/xcode-info-plist-source-code.png" alt-text="Screenshot that shows an example of the info plist source code in an Xcode file.":::
77
+
:::image type="content" source="../../media/xcode-info-plist-source-code.png" alt-text="Screenshot that shows example source code for the information property list in an Xcode file.":::
78
78
79
79
1. To verify that device permission requests are added correctly, select**OpenAs**>**PropertyList**. Check that the information property list looks similar to the following example:
80
80
@@ -86,27 +86,28 @@ In the Xcode project, under **Build Settings**, set the **Enable Bitcode** optio
86
86
87
87
:::image type="content" source="../../media/xcode-bitcode-option.png" alt-text="Screenshot that shows the Build Settings option to turn off Bitcode.":::
88
88
89
-
### Download a Chat Icon
89
+
### Download a Chat icon
90
90
91
-
-Download an icon from [here](https://github.com/microsoft/fluentui-system-icons/blob/master/assets/Chat/SVG/ic_fluent_chat_24_regular.svg).
92
-
-Open downloaded file and change `fill` to the`fill="#FFFFFF"`.
93
-
-Inthe Xcode go to Assets. Create a new image set and name it ic_fluent_chat_24_regular. Select downloaded file as universal icon.
91
+
1.Download an icon from the [GitHub repository](https://github.com/microsoft/fluentui-system-icons/blob/master/assets/Chat/SVG/ic_fluent_chat_24_regular.svg).
92
+
1.Openthe downloaded file and change `fill` to `fill="#FFFFFF"`.
93
+
1.InXcode, go to **Assets**. Create a new image set and name it **ic_fluent_chat_24_regular**. Selectthe downloaded file as the universal icon.
94
94
95
95
## Initialize the composite
96
96
97
-
Toinitialize the composite:
97
+
Toinitialize the composite, go to `ViewController`and update connection settings:
98
98
99
-
-Go to `ViewController`and update connection settings:
100
-
-Replace`TEAM_MEETING_LINK` with the Teams meeting link.
101
-
-Replace`ACS_ENDPOINT` with your ACS resource's endpoint.
102
-
- Replace `DISPLAY_NAME` with your name.
103
-
- Replace `USER_ID` with ACS user ID.
104
-
- Replace `USER_ACCESS_TOKEN` with your token.
99
+
-Replace`TEAM_MEETING_LINK` with the Teams meeting link.
100
+
-Replace`ACS_ENDPOINT` with your AzureCommunicationServices resource's endpoint.
101
+
- Replace `DISPLAY_NAME` with your name.
102
+
- Replace `USER_ID` with your Azure Communication Services user ID.
103
+
- Replace `USER_ACCESS_TOKEN` with your token.
105
104
106
-
### Get a Teams meeting chat thread for a Communication Services user
107
-
The Teams meeting details can be retrieved using Graph APIs, detailed in [Graph documentation](/graph/api/onlinemeeting-createorget). The Communication Services Calling SDK accepts a full Teams meeting link or a meeting ID. They're returned as part of the `onlineMeeting` resource, accessible under the [joinWebUrl](/graph/api/resources/onlinemeeting) property
105
+
### Get a Teams meeting chat thread for an Azure Communication Services user
106
+
107
+
You can retrieve Teams meeting details by using Graph APIs, as described in the [Graph documentation](/graph/api/onlinemeeting-createorget). The Azure Communication Services Calling SDK accepts a full Teams meeting link or a meeting ID. They're returned as part of the `onlineMeeting` resource, which is accessible under the [joinWebUrl](/graph/api/resources/onlineMeeting) property.
108
+
109
+
With the GraphAPIs, you can also obtain the `threadID` value. The response has a `chatInfo` object that contains the `threadID` value.
108
110
109
-
With the GraphAPIs, you can also obtain the threadID. The response has a chatInfo object that contains the threadID.
0 commit comments