Skip to content

Commit e75f21b

Browse files
authored
Update manage-calls-web.md
1 parent d4a9769 commit e75f21b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

articles/communication-services/how-tos/calling-sdk/includes/manage-calls/manage-calls-web.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,48 @@ Check is screen sharing is on. It returns `Boolean`.
365365
```js
366366
const isScreenSharingOn = call.isScreenSharingOn;
367367
```
368+
## Send or receive a reaction from other participants
369+
Within ACS you can send and receive reactions when on a group call:
370+
- Like :+1:
371+
- Love :heart:
372+
- Applause :clap:
373+
- Laugh :smile:
374+
- Surprise :open_mouth:
375+
376+
To send a reaction you will use the `sendReaction(reactionMessage)` API. To receive a reaction message will be buit with Type `ReactionMessage` which uses `Reaction` enums as an attribute.
377+
378+
You will need to subscribe for events which provide the subscriber event data as:
379+
```javascript
380+
export interface ReactionEventPayload {
381+
/**
382+
* identifier for a participant
383+
*/
384+
identifier: CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier;
385+
/**
386+
* reaction type received
387+
*/
388+
reactionMessage: ReactionMessage;
389+
}
390+
```
391+
392+
You can determine which reaction is coming from which participant with `identifier` attribute and gets the reation type from `ReactionMessage`.
393+
394+
### Sample on how to send a reaction in a meeting
395+
```javascript
396+
const reaction = call.feature(SDK.Features.Reaction);
397+
const reactionMessage: SDK.ReactionMessage = {
398+
reactionType: 'like'
399+
};
400+
await reaction.sendReaction(reactionMessage);
401+
```
402+
403+
### Sample on how to receive a reaction in a meeting
404+
```javascript
405+
const reaction = call.feature(SDK.Features.Reaction);
406+
reaction.on('reaction', event => {
407+
// user identifier
408+
console.log("User Mri - " + event.identifier);
409+
// reaction message
410+
console.log("reaction message - " + JSON.stringify(event.reactionMessage));
411+
}
412+
```

0 commit comments

Comments
 (0)