Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs for showNotification custom actions #565

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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