Skip to content

Commit

Permalink
Document availability of realtime channels and how to test for it (#79)
Browse files Browse the repository at this point in the history
* Document availability of realtime channels and how to test for it

* Update src-docs/spec/joinRealtimeChannel.md

Co-authored-by: Sebastian Klähn <[email protected]>

---------

Co-authored-by: Sebastian Klähn <[email protected]>
  • Loading branch information
Simon-Laux and Septias authored Jun 21, 2024
1 parent 125a6ce commit afcea51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src-docs/spec/joinRealtimeChannel.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ Per-app realtime channels are:
Calling `joinRealtimeChannel` a second time without leaving the prior one
will throw an error.

## Check if the API is available

This API is experimental and may not be implemented by every messenger yet.
Check if it is available with `window.webxdc.joinRealtimeChannel !== undefined`

For Delta Chat, you need at least version 1.46 to enable the feature
in the settings under `Settings -> Advanced -> Experimental Features -> Realtime Webxdc Channels`.
Without enabling the feature, the API is available but not working.

## `realtimeChannel.setListener((data) => {})`

Start listening on the realtime channel using the specified callback.
Expand Down

0 comments on commit afcea51

Please sign in to comment.