web-push-csharp icon indicating copy to clipboard operation
web-push-csharp copied to clipboard

Urgency option set to High

Open Light407 opened this issue 1 year ago • 0 comments

Hi, does anyone know how to set the Urgency option to High in the options? Not sure how I can combine that and vapiddetails, right now I am doing like this

 var vapidDetailsObject = new Dictionary<string, string>
 {
     { "subject", "mailto:[email protected]"},
     { "publicKey", _publicKey },
     { "privateKey", _privateKey }
 };

 var options = new Dictionary<string, object>
 {
     { "vapidDetails", vapidDetailsObject},
     { "urgency", "high" },
 };

await webPushClient.SendNotificationAsync(pushSubscription, payload, options);

And then received error

System.ArgumentException: 'urgency is an invalid options. The valid options areheaders,gcmAPIKey,vapidDetails,TTL'

But according to this link it should be a valid option: https://github.com/web-push-libs/web-push

Saw in the code that it seems hardcoded which options to allow but how can I set urgency to high?

Light407 avatar Nov 22 '24 03:11 Light407