Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messaging example does not works #812

Open
emremutlu08 opened this issue Jul 19, 2024 · 4 comments
Open

Messaging example does not works #812

emremutlu08 opened this issue Jul 19, 2024 · 4 comments
Assignees

Comments

@emremutlu08
Copy link

Step 1: Describe your environment

Operating system: MacOS
Browser: Safari/Chrome
Firebase SDK version: 10.1.0

Step 2: Describe the problem:

I already gave the permissions however the ui is still asking for permissions. In the browser console, it says: "An error occurred while retrieving token. FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:5173/firebase-cloud-messaging-push-scope') with script ('http://localhost:5173/firebase-messaging-sw.js'): ServiceWorker script evaluation failed (messaging/failed-service-worker-registration). "
Screenshot 2024-07-19 at 11 03 46

Steps to reproduce:

  1. git clone https://github.com/firebase/quickstart-js
  2. cd messaging/
  3. fill config.ts
  4. npm install -g firebase-tools
  5. firebase login
  6. firebase use --add
  7. npm install
  8. firebase emulators:start
  9. npm run dev

Observed Results:

Expected Results:

  • What did you expect to happen?
    It should give me the notifications
@bunniesnu
Copy link

Did you fix it? Stuck with the same problem. I would like to know the solution.

@0wwafa
Copy link

0wwafa commented Aug 31, 2024

same here! I need a f*ing working example! everything worked until 2 weeks ago.. now nothing works and the examples don't work too!

@mgszy
Copy link

mgszy commented Sep 23, 2024

Any update on this? Just came across this issue myself.

@mgszy
Copy link

mgszy commented Sep 24, 2024

For anyone else having this problem, I found a workaround. If I follow the steps provided under the "Running the app using the Firebase CLI" header in the readme.md then it generates the registration token.

It is also worth noting the examples given to send a message use the legacy approach and should be updated to the newer suggested way to push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants