Hi everyone, I’m currently building a web-app in Google AI Studio and I’ve run into a serious issue while trying to implement Firebase Cloud Messaging (push notifications).
What I’m trying to do:
-
Register a Service Worker (firebase-messaging-sw.js) to handle push notifications.
-
Host my React app built with Vite inside Google AI Studio.
-
Use Firebase / Google Cloud for the backend.
The problems I’m facing:
-
Service Worker file
In a normal setup I’d put firebase-messaging-sw.js at the root of my hosting environment. But in AI Studio I don’t have direct access to the root directory or a traditional file system. This leads to 404 errors or “Failed to register Service Worker” in the console.
-
Notifications not triggering
Because of the Service Worker problem, FCM push notifications aren’t delivered. I’ve already configured my Firebase project, Cloud Functions, and CORS settings correctly — it’s specifically the Service Worker location that’s blocking me.
-
No direct file management
In AI Studio I can only upload individual files or edit code inside the browser IDE. I can’t easily copy build artifacts like in a normal hosting environment, and there’s no obvious way to set the Service Worker at the root level.
I need browser push notifications. Does someone has an idea how to implement it in ai studio without file access?
THX
Martin