-
Notifications
You must be signed in to change notification settings - Fork 111
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
Webpush not triggering notifcations to safari #201
Comments
@deepak469 same problem here. Any updates? |
I found this forum saying we should use the HTTP/2 based interface: https://developer.apple.com/forums/thread/680366 |
Anyone else have a solution to this? Tried using HTTP/2 by changing the dependencies and rebuilding. No joy. I think HTTP/2 is a requirement for APN endpoints anyway. The documentation for using the Push API endpoints states both are supported. I keep getting a 403 returned with reason BadJwtToken. The reasons for this are listed in the Apple documentation https://developer.apple.com/documentation/usernotifications/sending_web_push_notifications_in_safari_and_other_browsers but I’m not sure what could be the problem with the JWT. However, when I test the JWT in jwt.io I get an invalid signature error. Could this be the issue? |
In my case the problem was that I was sending "[email protected]" as a |
Yeah, also handled (and solved) this for a demo yesterday. Although the spec/rfc says the subject claim MAY be required, Apple seems to changed it to a MUST for their service. As @aistomin already pointed out, the Apple developer documentation guide claims this actually. Overseen this also at first.
Of course you should not use an example mail address uri, but a real one. IMHO this can be technical contact address like your domain have some, just in case the push service have to contact you in situations. |
Actually I already had the same problem with Firefox in the past. |
Ah, right. That was on my todo list, but also solved now. Thanks. Although being slightly off-topic, but the actual problem is not to comply with the specific push server implementation of the vendor (here Apple). Is anyone aware of documents from Google/Mozilla/Microsoft like the one from Apple? Everything I found so far are different and incomplete docs/guides from third parties ("community"), which do not comply with the actual vendor implementations. |
Thanks guys. Really can't believe this was so simple in the end. I actually did have subject, but it was malformed (or at least malformed according to Apple's restrictions). My subject was in the format "mailto: <[email protected]>". Apple doesn't like the space or the angle brackets. That's a few days I won't get back! |
@aistomin thank you so much for the solution, now my safari works like a charm but on Chrome I get: Did you face this issue? Did you make another change in the lib to send using HTTP/2? |
@VanessaCarpes no, I didn't do any changes besides this |
Well, afaik the requirement for HTTP/2 is for the APNS of (native) apps only, in case of Apple Both the standard and the given documentation guide by guide clearly state HTTP/1.1 have to work. Even the client-server connection (i.e. browser fetching subscriptions) seems to rely in HTTP/1.1. Given the error message, I would suggest to recheck the followings
Also for the records: iOS 16.4b, PWA and Web Push is finally working. |
@VanessaCarpes I've created a tiny demo app here: https://github.com/aistomin/webpush-demo This code I've tested just now with Chrome and it works. You may try it with your configuration to see how it goes in the isolated environment. I hope it will help you to find what is the cause of your problem. |
Yes, using this lib works perfectly, but using the impl to send HTTP/2 I had that issue I mentioned before just on Chrome, Safari worked. For now, I'll stay with this lib ;) |
Closing this issue, as the problem seems to be resolved. |
restriction from Apple and has been discussed in this issue: web-push-libs/webpush-java#201 (comment)
The web-push notifications are working fine for chrome and firefox, but not working for safari v16 browser.
The text was updated successfully, but these errors were encountered: