.NET 9 console app that reads WhatsApp Desktop notifications on Windows 11 and exposes them via a local WebSocket for the bridge backend to consume. Also accepts reply-request messages and types them into WhatsApp Desktop via Win32 SendInput.
Part of the WhatsApp G2 Bridge stack:
WhatsApp Desktop → [THIS APP] → WebSocket → Bridge Backend → SSE → G2 app → Glasses
↓
(voice replies via Whisper)
- Windows 10 19041+ or Windows 11
- .NET 9 SDK
- WhatsApp Desktop (free from Microsoft Store or web.whatsapp.com/download)
- WhatsApp Desktop must be logged in and running (can be minimized)
- Notification access permission for this app (Windows prompts you on first run)
Microsoft Store: ms-windows-store://pdp/?productid=9NKSQGP7F2NH or https://www.whatsapp.com/download
Log in by scanning the QR code with your phone.
cd WhatsAppG2Bridge
dotnet build
dotnet runOn first run, Windows will prompt you to allow notification access. Go to:
Settings → Privacy & security → Notifications → Let apps access your notifications
and enable it for this app.
When a new WhatsApp message arrives, you should see:
[WhatsApp] Alex: Hey, quer almoçar?
in the console output.
Uses Windows.UI.Notifications.Management.UserNotificationListener — an official Windows API available since Windows 10 19041. Polls every 500 ms for new toast notifications, filters for WhatsApp, and parses the MessagingStyle payload correctly (the bug that probably makes Even Realities' own forwarder silent on WhatsApp).
WhatsApp notifications come in two forms:
- Direct message: two text lines — sender name + body
- Group message: two text lines — group name + "SenderName: message body"
The parser detects both patterns. Group sender is annotated as "João (Família)" so the replier knows both the chat name and who sent it.
Exposes a WebSocket on ws://localhost:8788/ where the Node backend connects. Messages flow backend-bound; reply requests flow app-bound.
- Outgoing:
{ type: "message", id, sender, text, timestamp, isGroup } - Incoming:
{ type: "reply", recipient, text }
Also exposes GET /health for quick checks.
When a reply request arrives, the app:
- Finds the WhatsApp Desktop window via
EnumWindows+GetWindowText - Brings it to foreground (restoring if minimized)
- If a recipient is specified, opens search via
Ctrl+Fand selects the top match - Types the reply text via
SendInput(Unicode, handles accents and emoji) - Presses
Enterto send
Important: this is UI automation of an official app — no WhatsApp ToS violation, no risk of account ban (unlike Baileys/whatsapp-web.js). It's the same mechanism Wear OS notifications use.
- WhatsApp Desktop must be open (can be minimized to system tray but not closed)
- Windows must be unlocked when a reply is sent (SendInput requires interactive session)
- Non-BMP emoji (like 🙂) work via SendInput surrogate pairs
- Group replies: recipient matching by chat name may fail if the group has a near-duplicate name
- Notifications for attachments (images, voice notes, videos): the parser sees only the caption / "Photo" / "Voice message" placeholder text
- This app only reads notifications — it never accesses the WhatsApp database or message content beyond what Windows surfaces
- The WebSocket server binds to
localhostonly — not accessible from the network - No telemetry, no data leaves your PC except via the explicit WebSocket connection to the local backend
MIT