Sending Push Notifications to Safari from Java

Hello all!

I am trying to get the Web Push API to work with my app and Safari on iOS. I can register fine in Safari ... But, when trying to send my request to the endpoint I receive a 403 with reason: BadJwtToken.

I've verified the token being sent in the Authentication header is valid. Also, the code I am using to send the Push request works perfectly on Chrome & Edge.

Has anyone else experienced this behaviour? Any suggestions would be greatly appreciated.

Accepted Reply

Really can't believe this was so simple in the end. The problem was the subject in the JWT. 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_address>". It seems Safari doesn't like the space or the angle brackets.

Replies

Really can't believe this was so simple in the end. The problem was the subject in the JWT. 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_address>". It seems Safari doesn't like the space or the angle brackets.