Unified Push

Chatty Matrix Push notifications

You need

  • Chatty as example application
  • kunifiedpush as distributor
  • A Push server (e.g. ntfy)
  • A Matrix push gateway (e.g. ntfy)
  • A Matrix server that sends push notifications (e.g. synapse)

It's recommended to run these on your own so you can peek at all points of the chain.

Server side

 curl https://ntfy.example.com/_matrix/push/v1/notify
 {"unifiedpush":{"gateway":"matrix"}}

Client side

  • Install and start kunified push. I'm currently using this branch
  sudo apt install --no-install-recommends extra-cmake-modules qmake6 qt6-base-dev qt6-websockets-dev libkf6coreaddons-dev libkf6kcmutils-dev libkf6service-dev
  git clone https://github.com/agx/kunifiedpush/tree/chatty
  cmake -DCMAKE_INSTALL_PREFIX=/usr/local -S . -B _build
  make -C _build install
  • Add kunifiedpush configuration
  mkdir -p ~/.config/KDE/
  cat <<EOF > ~/.config/KDE/kunifiedpush-distributor.conf
  [Ntfy]
  Url=https://ntfy.example.com/

  [PushProvider]
  Type=Ntfy
  EOF
  • You can test this with the demo notifier (_build/bin/demo-notifier)

  • Install and run chatty. I'm currently using this MR

sudo apt build-dep chatty
git clone -b matrix/pushers https://gitlab.gnome.org/guidog/chatty
meson setup _build
meson compile -C _build
  • Run chatty and add a matrix user.
  G_MESSAGES_DEBUG=chatty-uf-connector _build/run -vvvvv
  • Check if chatty exposes the connector object on DBus
busctl tree --user sm.puri.Chatty
├─ /org
│ └─ /org/unifiedpush
│   └─ /org/unifiedpush/Connector
└─ /sm
  └─ /sm/puri
    └─ /sm/puri/Chatty
      └─ /sm/puri/Chatty/window
        └─ /sm/puri/Chatty/window/1
  • Add the push server. Use URL from above as push server (https://ntfy.example.com/_matrix/push/v1/notify)
  • This should happen:
    • Chatty calls Register on the distributor
    • The distributor responds with NewEndpoint
    • Chatty stores that in ~/.config/chatty/unified-push.cfg
    • When sending a notification into a room the user is part of you should see

      chatty-uf-connector[31115]: DEBUG: Received message:

If things don't work

  • Make sure chatty's unified-push.cfg and kunifiedpush's kunifiedpush-distributor.conf agree on the token.
  • Make sure endpoint in kunifiedpush-distributor.conf and the pushkey of the pusher registered on the Matrix server match. You can get registered pushers via
  curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -X GET "${SERVER}/_matrix/client/r0/pushers"
  • Make the ntfy server gets the push notifications from the Matrix server. A simple way is to register the topic from the kunified push configuration via the webui.