SherClockHolmes / webpush-go

Web Push API Encryption with VAPID support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

send push message to ios return 403

ennnnzo opened this issue · comments

It works for me to send push message to https://fcm.googleapis.com/fcm/send/

But if send to https://web.push.apple.com/ returns 403

 {"reason":"BadJwtToken"}

I just didnt set subscriber in options.If set , It works.

commented

Indeed! Thanks for posting this as I was completely puzzled as to why it was working on desktop but not iOS!

resp, err := webpush.SendNotification([]byte(message), &pushSub, &webpush.Options{
			Subscriber:      "the-email-of-your-platform-sending-the-push-notif@test.com",
			VAPIDPublicKey:  vapidPublicKey,
			VAPIDPrivateKey: vapidPrivateKey,
		})