Skip to content

Commit

Permalink
feat: add docs for showNotification custom actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Avram Tudor authored and saghul committed Feb 25, 2025
1 parent dd0c254 commit 7e1e222
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/dev-guide/iframe-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,13 @@ Shows a custom notification. This affects only the local user.
If `uid` is provided, the notification will replace existing notification with the same `uid`. The `uid` can also be
passed to the `hideNotification` command to programmatically hide the notification.

If `customActions` is provided, when triggered, the actions will fire a [customNotificationActionTriggered](https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe-events#customnotificationactiontriggered) event with their corresponding uuid

```javascript
api.executeCommand('showNotification', {
title: String, // Title of the notification.
description: String, // Content of the notification.
customActions: Object(label: String, uuid: String)[], // Optional. Define custom actions to be displayed on the notification
uid: String, // Optional. Unique identifier for the notification.
type: String, // Optional. Can be 'normal', 'success', 'warning' or 'error'. Defaults to 'normal'.
timeout: String // optional. Can be 'short', 'medium', 'long', or 'sticky'. Defaults to 'short'.
Expand Down
14 changes: 14 additions & 0 deletions docs/dev-guide/iframe-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ The listener receives an object with the following structure:
}
```

### customNotificationActionTriggered

Callback that triggers for custom actions defined for the [showNotification](https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe-commands/#shownotification) command

The listener receives an object with the following structure:

```javascript
{
data: {
id: string // uuid of the triggered action
}
}
```

### dataChannelOpened

Indicates the data channel is open and thus messages can be sent over it.
Expand Down

0 comments on commit 7e1e222

Please sign in to comment.