laravel-notification-channels/webpush

403 Forbiden on Apple Safari

imrodrigoalves opened this issue · 9 comments

Hello,
I've been testing implementing this package in a project that implements an SPA and API.
It works well until we test on Safari.

The error I receive:
POST https://web.push.apple.com/IDENTIFIER` resulted in a 403 Forbidden response: {"reason":"BadJwtToken"}

I've researched into the reasons Apple provide for such here, yet I am not able to find a reason for it not to work :/

// env keys
VAPID_SUBJECT='http://localhost:8080' # Frontend URL for testing Service workers
VAPID_PUBLIC_KEY="MY-PUBLIC-KEY"
VAPID_PRIVATE_KEY="MY-PRIVATE-KEY"

According to a comment with the underlying library it should work without any changes. Read here.

Is someone able to help out?

Regards,
Rodrigo

We have the same problem and are also looking for a solution.

same problem here.

i had a problem with this
before
'subject' => 'admin@example.com'
after
'subject' => 'mailto: admin@example.com'

and also with this
before
'topic' => 'new_event', // not defined by default,
after
'topic' => 'newEvent', // not defined by default,

I know that topic is not required but anyway.

Our problem also was the 'subject' - after change to domain all was working fine.

Our problem also was the 'subject' - after change to domain all was working fine.

Can you elaborate on the change that was necessary on your side?

Apparently locally it doesn't work. Needs to be a domain with https

btw guys, how did you resolve 406 error from windows notify server?

Add an env var like:

VAPID_SUBJECT=mailto:xxx@example.de