-
Notifications
You must be signed in to change notification settings - Fork 879
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
Can't use getToken() on Safari: FirebaseError: Messaging: A problem occurred while subscribing the user to FCM: Request contains an invalid argument. (messaging/token-subscribe-failed).
#8356
Comments
Safari cannot currently use FCM messaging. The problem has been reported here #6620 (comment) as well. I reported the problem on the Flutter side here firebase/flutterfire#13048 too. |
Thank you for the feedback and the details. |
Hi @andynewman10, thanks for sharing steps to help us reproduce the issue.
Does this mean that this issue is a duplicate of #6620, or are these separate issues? |
My understanding is that #6620 seems to be about the general availability and support of Firebase Messaging on Safari, whereas the current issue is about a specific bug regarding |
Note that the official Firebase Messaging supported browsers page includes Safari and iOS Safari: https://firebase.google.com/docs/web/environments-js-sdk?hl=en#browsers Look at the 'Cloud Messaging' line. Funnily enough, the french, spanish and german versions of the same page list Safari and iOS Safari as not supported! French version: https://firebase.google.com/docs/web/environments-js-sdk?hl=fr#browsers. My locale is set to English so I can confirm that an English locale is not sufficient to solve the problem. |
Hi @andynewman10, thanks for reaching out to us. I tried replicating the behavior you've encountered using the quickstart, however, |
Hi, on which version of Safari and which macos did you try to replicate the issue we are having? |
I'm using Safari 17.5 and macOS Sonoma 14.5 |
@jbalidiong would you mind trying on macOS Ventura (13.x) and Safari 17.4/17.5? @andreififiita and I have issues on this setup, if you could try, this would be something extremely valuable for us and the macOS community in general. Note that I am note saying the problem should be fixed if you indeed reproduce the issue on Ventura - just that we would know which customers we can target for our app right now. |
Hi, Just wanted to say that we are having the exact issue @andynewman10 has described here with safari/firebase, i am surprised this is not being more widely reported unless its very specific setup/versions affected. We are seeing this against Sonoma 14.5 | Safari 17.5, 18 beta , latest firebase. It seems the problem may lie within the Safari implementation of Push API, the push subscribe call..
..is returning an empty subscription payload, likely as its quietly failing to create the subscription. This ties in with the missing params error from the firebase call to installs/registrations. I have put together a very quick vanilla web push test .. Web Push Test Project. It would be interesting to see if you get the same results. (its not actually wired up to an actual service, but allows us to test the push api). Clone it, npm install and npm run dev, it should print out the localhost url to console. The service worker is started on page load. In chrome, you will see it return the endpoint, p256dh values etc (used by FB presumably under the hood for the register/install call). Now run it in safari 17.5 (or even 18 beta) and it instead returns empty values, reload the page and a subscription was not created it seems. The promise doesn't catch however, it resolves, but something must be going wrong under the hood. Have tried switching around the SW startup logic to the user interaction event, same outcome. Sorry i can't provide more of a solution, i am convinced it's the safari implementation of the push API that's either broke, or they have made a requirement change and it should actually be throwing a useable error. Just to confirm, we are only seeing the issue in safari (both macos and ios). Chrome/Firefox, even on the same mac are working fine. Its not just a dev/local issue either, we are also seeing it in production. @jbalidiong The project above should give you a very quick test of this, since we are on the same versions it would be good to note your results. It may be a bug that needs to be raised with apple. |
@andyball89 I am also seeing that |
Thanks @andyball89 for a replication project. I was able to reproduce the behavior now. This will help us move forward with the investigation regarding the issue. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share. |
Hello, thank you for the reply. Can you please tell us, for the beginning, what is the difference between the success and failure tests regarding the Safari 17.4/17.5 on macos (ventura/sonoma)? We would be interested to know in which conditions (environment) you managed to run successfully the registration process in the first test (using quickstart project earlier last week, for example). |
The difference is that I was able to replicate the behavior using the sample project provided by @andyball89 for testing the Push API. It is working on Chrome and other browsers but not on Safari. Also, the project doesn't contain any Firebase dependencies and we can rule out that this an SDK issue. |
Operating System
macOS Ventura 13.6.7, Intel processor
Browser Version
Safari 17.5 (18618)
Firebase SDK Version
10.12.3
Firebase SDK Product:
Messaging
Describe your project's tooling
Plain javascript
Describe the problem
The following exception is raised when trying to get an FCM token on Safari:
Steps and code to reproduce issue
Notification
permission denied: if you're using macOS Ventura, create a shortcut to the test web page on your desktop (I just use http://localhost/...), then double click this shortcut to open the web. If you're using macOS Sonoma, I believe you can use the 'Add to dock' feature to do the same thing.I also tested with firebase-js-sdk 9.6.0, with identical results.
My Firebase set up does work perfectly fine on Chrome and Firefox (macOS and Windows platforms).
The text was updated successfully, but these errors were encountered: