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
title: Custom Data Model Injection over the UI Library
2
+
title: Inject a custom data model in the UI Library
3
3
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.
5
5
author: garchiro7
6
6
ms.author: jorgegarc
7
7
ms.service: azure-communication-services
@@ -10,34 +10,36 @@ ms.date: 05/24/2022
10
10
ms.custom: template-how-to
11
11
zone_pivot_groups: acs-plat-web-ios-android
12
12
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.
14
14
---
15
15
16
-
# Custom Data Model Injection
16
+
# Inject a custom data model in the UI library for an application
17
17
18
-
Azure Communication Services uses an identityagnostic 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.
19
19
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.
21
21
22
22
## Prerequisites
23
23
24
24
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
25
25
- 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
28
30
29
31
::: 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)]
31
33
::: zone-end
32
34
33
35
::: 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)]
35
37
::: zone-end
36
38
37
39
::: 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)]
39
41
::: zone-end
40
42
41
43
## Next steps
42
44
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)
Copy file name to clipboardExpand all lines: articles/communication-services/how-tos/ui-library-sdk/includes/data-model/android.md
+31-24Lines changed: 31 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
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.
3
3
author: garchiro7
4
4
5
5
ms.author: jorgegarc
@@ -8,33 +8,38 @@ ms.topic: include
8
8
ms.service: azure-communication-services
9
9
---
10
10
11
-
Azure Communication UI [opensource 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).
12
12
13
-
### Local Participant View Customization
13
+
### Local participant view customization
14
14
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.
16
16
17
-
#### Local Options
17
+
#### Local options
18
18
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.
20
20
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.
22
22
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.
24
24
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
26
26
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.
28
28
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`:
30
30
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.
32
33
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.
34
39
35
40
#### Usage
36
41
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`.
38
43
39
44
#### [Kotlin](#tab/kotlin)
40
45
@@ -73,26 +78,27 @@ final CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions()
| :::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."::: |
81
87
82
-
### Remote Participant View Customization
88
+
### Remote participant view customization
83
89
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.
85
91
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.
87
93
88
94
#### Usage
89
95
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.
91
97
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:
| :::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