Appwrite Push Notifications: "Unknown error" when sending to valid (anonymous) topic subscriber
- 0
- 1
- Web
- Sites
- Auth
- Messaging
- Cloud
Hi all,
I'm running into an issue with Appwrite push notifications in my web project. When I try to manually send a notification to a user from the Appwrite web console, I get the following error:
Failed sending to target [target id] with error: Unknown error
There are no errors in the browser frontend or on the Astro website server. Everything appears to be working fine on the client side, and the notification permission flow completes successfully.
Additional context:
When a user enables notifications, they are properly added as a subscriber to the relevant topic(s) via the Appwrite SDK. The topic subscription logic completes without error, and the user’s target ID and topic mapping are stored as expected.
Project context:
- Frontend: Astro + React, using Appwrite JS SDK and Firebase for push notifications.
- Appwrite version: 21.5.0 (npm package)
- Firebase version: 12.11.0
- Notifications are initialized via a function like this:
export function initializeNotifications(options: InitializeNotificationsOptions = {}): NotificationRuntime { /* ... */ }
- The push identifier and target ID are generated and stored in localStorage.
- Topic subscriptions are managed and appear to succeed (no errors thrown).
- Example of the notification state types:
export type NotificationState =
| { kind: "idle"; level: "neutral"; title: string; }
| { kind: "subscribed"; level: "success"; title: string; }
| { kind: "failed"; level: "error"; title: string; canRetry: true; }
// ...etc
- The Appwrite project is configured with messaging enabled, and the topics are set up for push notifications.
What I've tried:
- Double-checked the push target ID and topic subscriptions.
- Verified that the Firebase config and VAPID key are correct.
- Ensured the browser has granted notification permissions.
- No errors in the browser console or network tab.
- No errors in the Astro server logs.
Question:
What could cause Appwrite to return "Unknown error" when sending a notification to a valid target, despite no errors on the frontend or server, and with users properly subscribed to topics? Are there any additional debugging steps or common misconfigurations I should check (especially with Firebase or push token registration)?
Any advice or pointers to relevant Appwrite/Firebase docs would be appreciated!
Just to reiterate appwrite console says they are valid targets
Is there another menu where I can view more detailed logs?
All of these targets are on different browsers and devices
Okay so I updated my api keys and credentials again and now I dont get an error 😁
but the notifications still are not sending
Okay if you guys are sending notifications without any errors but the browser isn't reciving it then your service worker is the problem
Recommended threads
- Inviting members while SMTP is disabled ...
Issue: https://github.com/appwrite/console/issues/3125 PR: https://github.com/appwrite/console/pull/3126
- Appwrite Sites: ERR_TOO_MANY_REDIRECTS o...
So, my domain was working perfectly fine with Vercel. I was using cloudflare CDN (still am) but CNAME was DNS-only. I switched over to appwrite, CNAME is still ...
- Charged after Downgrade
I downgraded from the pro plan last month, but it’s still trying to charge my card this month and my account has been restricted