Skip to content

Commit 0a3c478

Browse files
committed
Add raise hand feature doc for iOS and Windows
1 parent 86e3e3d commit 0a3c478

File tree

4 files changed

+224
-8
lines changed

4 files changed

+224
-8
lines changed

articles/communication-services/how-tos/calling-sdk/includes/raise-hand/raise-hand-android.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ ms.author: ruslanzdor
88
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
99

1010
> [!NOTE]
11-
> Raise Hand API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. To use this api please use 'alpha' release of Azure Communication Services Calling Web SDK
11+
> Raise Hand API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. To use this api please use 'beta' release of Azure Communication Services Calling Web SDK
1212
1313
Raise Hand is an extended feature of the core `Call` API. You first need to import calling Features from the Calling SDK:
1414

15-
```js
15+
```java
1616
import com.azure.android.communication.calling.RaiseHandFeature;
1717
```
1818

1919
Then you can get the feature API object from the call instance:
2020

21-
```js
21+
```java
2222
RaiseHandFeature raiseHandFeature = call.feature(Features.RAISE_HAND);
2323
```
2424

2525
### Raise and lower hand for current participant:
2626
Raise Hand state can be used in any call type: on 1:1 calls and on calls with many participants, in ACS and in Teams calls.
2727
If it Teams meeting - organizer will have ability to enable or disable raise hand states for all participants.
2828
To change state for current participant, you can use methods:
29-
```js
29+
```java
3030
RaiseHandFeature raiseHandFeature = call.feature(Features.RAISE_HAND);
3131
//raise
3232
raiseHandFeature.raiseHand();
@@ -36,7 +36,7 @@ raiseHandFeature.lowerHand();
3636

3737
### Lower hands for other participants
3838
Currently ACS calls aren't allowed to change state of other participants, for example, lower all hands. But Teams calls allow it using these methods:
39-
```js
39+
```java
4040
RaiseHandFeature raiseHandFeature = call.feature(Features.RAISE_HAND);
4141
//lower all hands on the call
4242
raiseHandFeature.lowerHandForEveryone();
@@ -51,7 +51,7 @@ raiseHandFeature.lowerHand(identifiers);
5151

5252
### Handle changed states
5353
The `Raise Hand` API allows you to subscribe to `raiseHandChanged` events. A `raiseHandChanged` event comes from a `call` instance and contain information about participant and new state.
54-
```js
54+
```java
5555
RaiseHandFeature raiseHandFeature = call.feature(Features.RAISE_HAND)
5656

5757
// event example : {identifier: CommunicationIdentifier, isRaised: true, order:1}
@@ -62,7 +62,7 @@ call.feature(Features.RAISE_HAND).addOnRaiseHandReceivedListener(raiseHandEvent
6262

6363
### List of all participants with active state
6464
To get information about all participants that have Raise Hand state on current call, you can use this api array is sorted by order field:
65-
```js
65+
```java
6666
RaiseHandFeature raiseHandFeature = call.feature(Features.RAISE_HAND);
6767
List<RaiseHand> activeStates = raiseHandFeature.getStatus();
6868
```
@@ -72,7 +72,7 @@ It possible to get order of all raised hand states on the call, this order is st
7272
There are two ways: get all raise hand state on the call or use `raiseHandChanged` event subscription.
7373
In event subscription when any participant will lower a hand - call will generate only one event, but not for all participants with order above.
7474

75-
```js
75+
```java
7676
const raiseHandFeature = call.feature(Features.RaiseHand );
7777
for (RaiseHand state : raiseHandFeature.getStatus() {
7878
CommunicationIdentifier identifier = state.getIdentifier();
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
author: ruslanzdor
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 02/06/2022
6+
ms.author: ruslanzdor
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-ios.md)]
9+
10+
> [!NOTE]
11+
> Raise Hand API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. To use this api please use 'beta' release of Azure Communication Services Calling Web SDK
12+
13+
Raise Hand is an extended feature of the core `Call` API. You first need to import calling Features from the Calling SDK:
14+
15+
```swift
16+
import AzureCommunicationCalling
17+
```
18+
19+
Then you can get the feature API object from the call instance:
20+
21+
```swift
22+
@State var raisehandFeature: RaiseHandCallFeature?
23+
24+
raiseHandFeature = self.call!.feature(Features.raiseHand)
25+
```
26+
27+
### Raise and lower hand for current participant:
28+
Raise Hand state can be used in any call type: on 1:1 calls and on calls with many participants, in ACS and in Teams calls.
29+
If it Teams meeting - organizer will have ability to enable or disable raise hand states for all participants.
30+
To change state for current participant, you can use methods:
31+
```swift
32+
//publish raise hand state for local participant
33+
raisehandFeature.raiseHand(completionHandler: { (error) in
34+
if let error = error {
35+
print ("Feature failed raise a hand %@", error as Error)
36+
}
37+
})
38+
39+
//remove raise hand state for local participant
40+
raisehandFeature.lowerHand(completionHandler: { (error) in
41+
if let error = error {
42+
print ("Feature failed lower hand %@", error as Error)
43+
}
44+
})
45+
46+
```
47+
48+
### Lower hands for other participants
49+
Currently ACS calls aren't allowed to change state of other participants, for example, lower all hands. But Teams calls allow it using these methods:
50+
```swift
51+
52+
// remove raise hand states for all participants on the call
53+
raisehandFeature.lowerHandForEveryone(completionHandler: { (error) in
54+
if let error = error {
55+
print ("Feature failed lower all hands %@", error as Error)
56+
}
57+
})
58+
59+
// remove raise hand states for all remote participants on the call
60+
let identifiers = (call?.remoteParticipants.map {$0.identifier})!;
61+
raisehandFeature.lowerHand(participants: identifiers, completionHandler: { (error) in
62+
if let error = error {
63+
print ("Feature failed lower hands %@", error as Error)
64+
}
65+
})
66+
67+
// remove raise hand state of specific user
68+
var identifiers : [CommunicationIdentifier] = []
69+
identifiers.append(CommunicationUserIdentifier("<USER_ID>"))
70+
raisehandFeature.lowerHand(participants: identifiers, completionHandler: { (error) in
71+
if let error = error {
72+
print ("Feature failed lower hands %@", error as Error)
73+
}
74+
})
75+
76+
```
77+
78+
### Handle changed states
79+
The `Raise Hand` API allows you to subscribe to `didReceiveRaiseHandEvent` events. A `didReceiveRaiseHandEvent` event comes from a `call` instance and contain information about participant and new state.
80+
```swift
81+
self.callObserver = CallObserver(view:self)
82+
83+
raisehandFeature = self.call!.feature(Features.raiseHand)
84+
raisehandFeature!.delegate = self.callObserver
85+
86+
public class CallObserver : NSObject, RaiseHandCallFeatureDelegate
87+
{
88+
// event example : {identifier: CommunicationIdentifier, isRaised: true, order:1}
89+
public func raiseHandCallFeature(_ raiseHandCallFeature: RaiseHandCallFeature, didReceiveRaiseHandEvent args: RaiseHandEvent) {
90+
os_log("Raise hand feature updated: %s : %d", log:log, Utilities.toMri(args.identifier), args.isRaised)
91+
raiseHandCallFeature.status.forEach { raiseHand in
92+
os_log("Raise hand active: %s", log:log, Utilities.toMri(raiseHand.identifier))
93+
}
94+
}
95+
}
96+
```
97+
98+
### List of all participants with active state
99+
To get information about all participants that have Raise Hand state on current call, you can use this api array is sorted by order field:
100+
```swift
101+
raisehandFeature = self.call!.feature(Features.raiseHand)
102+
raisehandFeature.status.forEach { raiseHand in
103+
os_log("Raise hand active: %s", log:log, Utilities.toMri(raiseHand.identifier))
104+
}
105+
```
106+
107+
### Order of raised Hands
108+
It possible to get order of all raised hand states on the call, order is started from 1 and will be sorted.
109+
There are two ways: get all raise hand state on the call or use `didReceiveRaiseHandEvent` event subscription.
110+
In event subscription when any participant will lower a hand - call will generate only one event, but not for all participants with order above.
111+
112+
```swift
113+
raisehandFeature = self.call!.feature(Features.raiseHand)
114+
raisehandFeature.status.forEach { raiseHand in
115+
os_log("Raise hand active: %s with order %d", log:log, Utilities.toMri(raiseHand.identifier), raiseHand.order)
116+
}
117+
```
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
author: ruslanzdor
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 02/06/2022
6+
ms.author: ruslanzdor
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-windows.md)]
9+
10+
> [!NOTE]
11+
> Raise Hand API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. To use this api please use 'beta' release of Azure Communication Services Calling Web SDK
12+
13+
Raise Hand is an extended feature of the core `Call` API. You first need to import calling Features from the Calling SDK:
14+
15+
```csharp
16+
using Azure.Communication.Calling.WindowsClient;
17+
```
18+
19+
Then you can get the feature API object from the call instance:
20+
21+
```csharp
22+
private RaiseHandCallFeature raiseHandCallFeature;
23+
24+
raiseHandCallFeature = (RaiseHandCallFeature)call.GetCallFeatureExtension(CallFeatureType.RaiseHand);
25+
```
26+
27+
### Raise and lower hand for current participant:
28+
Raise Hand state can be used in any call type: on 1:1 calls and on calls with many participants, in ACS and in Teams calls.
29+
If it Teams meeting - organizer will have ability to enable or disable raise hand states for all participants.
30+
To change state for current participant, you can use methods:
31+
```csharp
32+
//publish raise hand state for local participant
33+
raiseHandCallFeature.RaiseHandAsync();
34+
35+
//remove raise hand state for local participant
36+
raiseHandCallFeature.LowerHandAsync();
37+
38+
```
39+
40+
### Lower hands for other participants
41+
Currently ACS calls aren't allowed to change state of other participants, for example, lower all hands. But Teams calls allow it using these methods:
42+
```csharp
43+
44+
// remove raise hand states for all participants on the call
45+
raiseHandCallFeature.LowerHandForEveryoneAsync();
46+
47+
// remove raise hand states for all remote participants on the call
48+
var participants = call.RemoteParticipants;
49+
var identifiers = participants.Select(p => p.Identifier).ToList().AsReadOnly();
50+
raiseHandCallFeature.LowerHandAsync(identifiers);
51+
52+
// remove raise hand state of specific user
53+
var identifiers = new List<CallIdentifier>();
54+
identifiers.Add(new UserCallIdentifier("USER_ID"));
55+
raiseHandCallFeature.LowerHandAsync(identifiers);
56+
```
57+
58+
### Handle changed states
59+
The `Raise Hand` API allows you to subscribe to `didReceiveRaiseHandEvent` events. A `didReceiveRaiseHandEvent` event comes from a `call` instance and contain information about participant and new state.
60+
```swift
61+
raiseHandCallFeature = (RaiseHandCallFeature)call.GetCallFeatureExtension(CallFeatureType.RaiseHand);
62+
raiseHandCallFeature.OnRaiseHandReceived += OnRaiseHandChange;
63+
64+
private async void OnRaiseHandChange(object sender, RaiseHandEvent raiseHandEvent)
65+
{
66+
Trace.WriteLine("RaiseHandEvent: participant " + raiseHandEvent.Identifier + " is raised hand " + raiseHandEvent.IsRaised);
67+
}
68+
```
69+
70+
### List of all participants with active state
71+
To get information about all participants that have Raise Hand state on current call, you can use this api array is sorted by order field:
72+
```swift
73+
raiseHandCallFeature = (RaiseHandCallFeature)call.GetCallFeatureExtension(CallFeatureType.RaiseHand);
74+
foreach (RaiseHand rh in raiseHandCallFeature.Status.ToList())
75+
{
76+
Trace.WriteLine("Participant " + rh.Identifier.RawId + " has raised hand ");
77+
}
78+
```
79+
80+
### Order of raised Hands
81+
It possible to get order of all raised hand states on the call, order is started from 1 and will be sorted.
82+
There are two ways: get all raise hand state on the call or use `didReceiveRaiseHandEvent` event subscription.
83+
In event subscription when any participant will lower a hand - call will generate only one event, but not for all participants with order above.
84+
85+
```swift
86+
raiseHandCallFeature = (RaiseHandCallFeature)call.GetCallFeatureExtension(CallFeatureType.RaiseHand);
87+
foreach (RaiseHand rh in raiseHandCallFeature.Status.ToList())
88+
{
89+
Trace.WriteLine(rh.Order + ". " + rh.Identifier.RawId);
90+
}
91+
```

articles/communication-services/how-tos/calling-sdk/raise-hand.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ During an active call, you may want to send or receive states from other users.
3535
[!INCLUDE [Raise Hand Client-side Android](./includes/raise-hand/raise-hand-android.md)]
3636
::: zone-end
3737

38+
::: zone pivot="platform-ios"
39+
[!INCLUDE [Record Calls Client-side iOS](./includes/record-calls/raise-hand-ios.md)]
40+
::: zone-end
41+
42+
::: zone pivot="platform-windows"
43+
[!INCLUDE [Manage Video Calls Windows](./includes/manage-video/raise-hand-windows.md)]
44+
::: zone-end
45+
3846
## Next steps
3947
- [Learn how to manage calls](./manage-calls.md)
4048
- [Learn how to manage video](./manage-video.md)

0 commit comments

Comments
 (0)