From 97de545c18c8f69b3378fd66f56494359ec3be6a Mon Sep 17 00:00:00 2001 From: Tobias Ladner Date: Wed, 5 Jun 2024 11:30:23 +0200 Subject: [PATCH] Push notifications where not showing up on Safari. This was due to a restriction from Apple and has been discussed in this issue: https://github.com/web-push-libs/webpush-java/issues/201#issuecomment-1443427513 --- docs/09-progressive-web-app.md | 2 +- src/BlazingPizza.Server/OrdersController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/09-progressive-web-app.md b/docs/09-progressive-web-app.md index 714a407f..016e3ac3 100644 --- a/docs/09-progressive-web-app.md +++ b/docs/09-progressive-web-app.md @@ -188,7 +188,7 @@ private static async Task SendNotificationAsync(Order order, NotificationSubscri var privateKey = "OrubzSz3yWACscZXjFQrrtDwCKg-TGFuWhluQ2wLXDo"; var pushSubscription = new PushSubscription(subscription.Url, subscription.P256dh, subscription.Auth); - var vapidDetails = new VapidDetails("mailto:", publicKey, privateKey); + var vapidDetails = new VapidDetails("mailto:someone@example.com", publicKey, privateKey); var webPushClient = new WebPushClient(); try { diff --git a/src/BlazingPizza.Server/OrdersController.cs b/src/BlazingPizza.Server/OrdersController.cs index adf19b41..17f2306c 100644 --- a/src/BlazingPizza.Server/OrdersController.cs +++ b/src/BlazingPizza.Server/OrdersController.cs @@ -106,7 +106,7 @@ private static async Task SendNotificationAsync(Order order, NotificationSubscri var privateKey = "OrubzSz3yWACscZXjFQrrtDwCKg-TGFuWhluQ2wLXDo"; var pushSubscription = new PushSubscription(subscription.Url, subscription.P256dh, subscription.Auth); - var vapidDetails = new VapidDetails("mailto:", publicKey, privateKey); + var vapidDetails = new VapidDetails("mailto:someone@example.com", publicKey, privateKey); var webPushClient = new WebPushClient(); try {