Open rsdickerson opened 6 months ago
Here's the StackOverflow post for reference. https://stackoverflow.com/questions/77809621/sending-web-push-to-apns-https-web-push-apple-com-responds-with-403-forbidde
It seems to me that your usage of the library is non-standard. Why bother creating your own Http objects? Maybe try following the simpler usage in the example code?
Seems to be related to this: https://github.com/web-push-libs/webpush-java/issues/201#issuecomment-1443258546
Thanks for the link @krissvaa to the comment. By adding a subject to the PushService it works 🥳 :
PushService(
"publicKey",
"privateKey",
"mailto:example@mail.com",
)
Dang. My bad. I should have updated you on how I got it working. Yes, adding the subject got it going.
The docs on the webpush-java library don't show this way of instantiating the PushService. I did find it clearly shown on webpush.
Has anyone got web push working with iOS Safari (w/PWA)?
I posted the following on StackOverflow, but got no response.
We can send web push from java server to PWA on Android/Chrome works fine, but sending to PWA on iPhone/Safari fails with 403 Forbidden.
Works fine on Android phone
Request to fcm.googleapis.com
Response
Fails on iPhone
Request to web.push.apple.com
Response
I'm using the webpush-java library to prepare the web push request. Here's the send code:
Any help would be greatly appreciated.