Skip to content

Commit 95880a2

Browse files
authored
Merge pull request #262072 from ShawnJackson/communication-services-how-tos
[AQ] edit pass: Communication Services how-to articles (batch 1)
2 parents bcbcec1 + b363b1b commit 95880a2

13 files changed

Lines changed: 227 additions & 226 deletions

File tree

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Custom Data Model Injection over the UI Library
2+
title: Inject a custom data model in the UI Library
33
titleSuffix: An Azure Communication Services how-to guide
4-
description: Use Azure Communication Services UI library for Mobile native to set up Custom Data Model Injection
4+
description: Set up custom data model injection in the Azure Communication Services UI Library.
55
author: garchiro7
66
ms.author: jorgegarc
77
ms.service: azure-communication-services
@@ -10,34 +10,36 @@ ms.date: 05/24/2022
1010
ms.custom: template-how-to
1111
zone_pivot_groups: acs-plat-web-ios-android
1212

13-
#Customer intent: As a developer, I want to set up the Custom Data Model Injection in my application
13+
#Customer intent: As a developer, I want to set up custom data model injection in the UI Library for my application.
1414
---
1515

16-
# Custom Data Model Injection
16+
# Inject a custom data model in the UI library for an application
1717

18-
Azure Communication Services uses an identity agnostic model where developers can [bring their own identities](../../concepts/identity-model.md). Contoso can get their data model and link it to Azure Communication Services identities. A developer's data model for a user most likely includes information such as their display name, profile picture or avatar, and other details. Information is used by developers to power their applications and platforms.
18+
Azure Communication Services uses an identity-agnostic model in which developers can [bring their own identities](../../concepts/identity-model.md). Developers can get their data model and link it to Azure Communication Services identities. The data model for a user most likely includes information such as display name, profile picture or avatar, and other details. Developers use this information to build their applications and platforms.
1919

20-
The UI Library makes it simple for developers to inject that user data model into the UI Components. When rendered, they show users provided information rather than generic information that Azure Communication Services has.
20+
The UI Library makes it simple for you to inject a user data model into the UI components. When you render the UI components, they show users the provided information rather than generic information from Azure Communication Services.
2121

2222
## Prerequisites
2323

2424
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2525
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
26-
- A `User Access Token` to enable the call client. For more information on [how to get a `User Access Token`](../../quickstarts/identity/access-tokens.md)
27-
- Optional: Complete the quickstart for [getting started with the UI Library composites](../../quickstarts/ui-library/get-started-composites.md)
26+
- A user access token to enable the call client. [Get a user access token](../../quickstarts/identity/access-tokens.md).
27+
- Optional: Completion of the [quickstart for getting started with the UI Library composites](../../quickstarts/ui-library/get-started-composites.md).
28+
29+
## Set up injection
2830

2931
::: zone pivot="platform-web"
30-
[!INCLUDE [Data model over the Web UI library](./includes/data-model/web.md)]
32+
[!INCLUDE [Data model over the Web UI Library](./includes/data-model/web.md)]
3133
::: zone-end
3234

3335
::: zone pivot="platform-android"
34-
[!INCLUDE [Data model over the Android UI library](./includes/data-model/android.md)]
36+
[!INCLUDE [Data model over the Android UI Library](./includes/data-model/android.md)]
3537
::: zone-end
3638

3739
::: zone pivot="platform-ios"
38-
[!INCLUDE [Data model over the iOS UI library](./includes/data-model/ios.md)]
40+
[!INCLUDE [Data model over the iOS UI Library](./includes/data-model/ios.md)]
3941
::: zone-end
4042

4143
## Next steps
4244

43-
- [Learn more about UI Library](../../concepts/ui-library/ui-library-overview.md)
45+
- [Learn more about the UI Library](../../concepts/ui-library/ui-library-overview.md)

articles/communication-services/how-tos/ui-library-sdk/includes/data-model/android.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: In this tutorial, you learn how to use the Calling composite on Android to customize the Participant Avatars and Display Names
2+
description: Learn how to use the Calling composite on Android to customize participant avatars and display names.
33
author: garchiro7
44

55
ms.author: jorgegarc
@@ -8,33 +8,38 @@ ms.topic: include
88
ms.service: azure-communication-services
99
---
1010

11-
Azure Communication UI [open source library](https://github.com/Azure/communication-ui-library-android) for Android and the sample application code can be found [here](https://github.com/Azure-Samples/communication-services-android-quickstarts/tree/main/ui-calling)
11+
For more information, see the [open-source Android UI Library](https://github.com/Azure/communication-ui-library-android) and the [sample application code](https://github.com/Azure-Samples/communication-services-android-quickstarts/tree/main/ui-calling).
1212

13-
### Local Participant View Customization
13+
### Local participant view customization
1414

15-
The UI Library gives developers the ability to provide a more customized experience regarding Participant information. At launch, developers can optionally inject local participant data. This local data isn't shared with the server and can be used to customize the display name and avatar of the local user.
15+
The UI Library gives developers the ability to provide a customized experience regarding participant information. At launch, you can optionally inject local participant data. This local data isn't shared with the server, and you can use it to customize the display name and avatar of the local user.
1616

17-
#### Local Options
17+
#### Local options
1818

19-
`CallCompositeLocalOptions` is the data model that can have `CallCompositeParticipantViewData` and `CallCompositeSetupScreenViewData`. It represents the local participant. By default, for remote participants, the UI library displays the `displayName` injected in `RemoteOptions` that is sent to Azure Communication Service backend server. If `CallCompositeParticipantViewData` is injected, the participant `displayName` and `avatar` are displayed in all avatar components locally.
19+
`CallCompositeLocalOptions` is the data model that can have `CallCompositeParticipantViewData` and `CallCompositeSetupScreenViewData`. It represents the local participant.
2020

21-
Similarly, for `CallCompositeSetupScreenViewData`, the `title` and `subtitle` in `CallCompositeSetupScreenViewData` overwrites the navigation bar's title and subtitle in premeeting screen respectively. By default, the UI library displays 'Setup' as the title and nothing as the subtitle.
21+
By default, for remote participants, the UI Library displays `displayName` information injected in `RemoteOptions`. This information is sent to the Azure Communication Services back-end server. If `CallCompositeParticipantViewData` is injected, the participant `displayName` and `avatar` information is displayed in all avatar components locally.
2222

23-
#### Local Participant View Data
23+
Similarly, for `CallCompositeSetupScreenViewData`, `title` and `subtitle` in `CallCompositeSetupScreenViewData` overwrite the navigation bar's title and subtitle on the premeeting screen, respectively. By default, the UI Library displays **Setup** as the title and nothing as the subtitle.
2424

25-
`CallCompositeParticipantViewData` is a class that set the `displayName`, `avatarBitmap` and `scaleType` for avatar control. This class is passed to the `CallCompositeLocalOptions` in order to customize the local participants view information.
25+
#### Local participant view data
2626

27-
This class is held in the `CallCompositeLocalOptions` object that represents options used locally on the device making the call.
27+
`CallCompositeParticipantViewData` is a class that sets `displayName`, `avatarBitmap`, and `scaleType` for avatar control. This class is passed to `CallCompositeLocalOptions` in order to customize the local participants' view information. This class is held in the `CallCompositeLocalOptions` object that represents options used locally on the device that makes the call.
2828

29-
`displayName` differs from the `displayName` passed in via the `CallCompositeRemoteOptions`. `CallCompositeParticipantViewData` `displayName` is only used locally as an override, where `CallCompositeRemoteOptions` `displayName` is passed to the server and shared with other participants. When `CallCompositeParticipantViewData` `displayName` isn't provided, `CallCompositeRemoteOptions` `displayName` is used.
29+
This instance of `displayName` differs from the `displayName` information passed in via `CallCompositeRemoteOptions`:
3030

31-
#### Setup Screen View Data
31+
- The `CallCompositeParticipantViewData` instance of `displayName` is only used locally as an override.
32+
- The `CallCompositeRemoteOptions` instance of `displayName` is passed to the server and shared with other participants.
3233

33-
`CallCompositeSetupScreenViewData` is an object that sets the `title` and `subtitle` for the navigationBar on call setup screen. If `subtitle` isn't defined, then subtitle is hidden. Here `title` is a required to set the `subtitle` but `subtitle` is optional when `title` is set. This class is locally stored and its information aren't sent up to the server.
34+
If you don't provide the `CallCompositeParticipantViewData` instance of `displayName`, the application uses the `CallCompositeRemoteOptions` instance of `displayName`.
35+
36+
#### Setup screen view data
37+
38+
`CallCompositeSetupScreenViewData` is an object that sets `title` and `subtitle` for the navigation bar on the call setup screen. If `subtitle` isn't defined, the subtitle is hidden. Here, `title` is required to set `subtitle`, but `subtitle` is optional when `title` is set. This class is locally stored, and its information isn't sent to the server.
3439

3540
#### Usage
3641

37-
To use the `CallCompositeLocalOptions`, pass the instance of `CallCompositeParticipantViewData` and/or `CallCompositeSetupScreenViewData` and inject `CallCompositeLocalOptions` to `callComposite.launch`.
42+
To use `CallCompositeLocalOptions`, pass the instance of `CallCompositeParticipantViewData` and/or `CallCompositeSetupScreenViewData`, and inject `CallCompositeLocalOptions` to `callComposite.launch`.
3843

3944
#### [Kotlin](#tab/kotlin)
4045

@@ -73,26 +78,27 @@ final CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions()
7378

7479
callComposite.launch(callLauncherActivity, remoteOptions, localOptions);
7580
```
81+
7682
-----
7783

78-
|Setup View| Calling Experience View|
84+
|Setup view| Calling experience view|
7985
| ---- | ---- |
80-
| :::image type="content" source="media/android-model-injection.png" alt-text="Screenshot of an Android data custom model injection."::: | :::image type="content" source="media/android-model-injection-name.png" alt-text="Screenshot of an Android data custom model injection with name."::: |
86+
| :::image type="content" source="media/android-model-injection.png" alt-text="Screenshot of Android data custom model injection."::: | :::image type="content" source="media/android-model-injection-name.png" alt-text="Screenshot of Android data custom model injection with name."::: |
8187

82-
### Remote Participant View Customization
88+
### Remote participant view customization
8389

84-
In some instances, you may wish to provide local overrides for remote participants to allow custom avatars and titles.
90+
In some instances, you might want to provide local overrides for remote participants to allow custom avatars and titles.
8591

86-
The process is similar to the local participant process, however the data is set when participants join the call. As a developer you would need to add a listener to when remote participants join the call, and then call a method to set the `CallCompositeParticipantViewData` for that remote user.
92+
The process is similar to the local participant process, but the data is set when participants join the call. As a developer, you would need to add a listener when remote participants join the call, and then call a method to set `CallCompositeParticipantViewData` for those remote users.
8793

8894
#### Usage
8995

90-
To set the participant view data for remote participant, set `setOnRemoteParticipantJoinedHandler`. On remote participant join, use callComposite `setRemoteParticipantViewData` to inject view data for remote participant. The participant identifier [CommunicationIdentifier](https://azure.github.io/azure-sdk-for-android/azure-communication-common/index.html) is to uniquely identify a remote participant.
96+
To set the view data for remote participants, set `setOnRemoteParticipantJoinedHandler`. On remote participant join, use `setRemoteParticipantViewData` for `callComposite` to inject view data for remote participants. The participant identifier [CommunicationIdentifier](https://azure.github.io/azure-sdk-for-android/azure-communication-common/index.html) uniquely identifies a remote participant.
9197

92-
Calls to `setRemoteParticipantViewData` return a result of `CallCompositeSetParticipantViewDataResult`, which has the following values.
98+
Calls to `setRemoteParticipantViewData` return a result of `CallCompositeSetParticipantViewDataResult`, which has the following values:
9399

94-
- CallCompositeSetParticipantViewDataResult.SUCCESS
95-
- CallCompositeSetParticipantViewDataResult.PARTICIPANT_NOT_IN_CALL
100+
- `CallCompositeSetParticipantViewDataResult.SUCCESS`
101+
- `CallCompositeSetParticipantViewDataResult.PARTICIPANT_NOT_IN_CALL`
96102

97103
#### [Kotlin](#tab/kotlin)
98104

@@ -117,8 +123,9 @@ callComposite.addOnRemoteParticipantJoinedEventHandler { remoteParticipantJoined
117123
}
118124
});
119125
```
126+
120127
-----
121128

122129
|Participants list|
123130
| ---- |
124-
| :::image type="content" source="media/android-model-injection-remote.png" alt-text="Screenshot of the Android remote participants view data injection."::: |
131+
| :::image type="content" source="media/android-model-injection-remote.png" alt-text="Screenshot of Android remote participant view data injection."::: |

0 commit comments

Comments
 (0)