Skip to content

viklover/WebPush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebPush

Nuget License Unit tests workflow

Simple implementation of Web Push notification protocol for .NET.

📚 Features

  • No external dependencies — only built-in .NET libraries
  • Fully asynchronous API

🚀 Quick start

Installation:

dotnet add package Viklover.WebPush --version 1.0.1
// Use subscription received from browser
var subscription = new WebPushSubscription(
    endpoint: "https://push.example.com/...",
    auth: "base64-auth-secret",
    p256dh: "base64-public-key"
);

// Use your VAPID keys
var vapidKeys = new WebPushVapidKeys(
    publicKey: "base64-vapid-public-key",
    privateKey: "base64-vapid-private-key"
);

// Send notification
var client = new WebPushClient(vapidKeys, notificationTTL: TimeSpan.FromHours(24));
await client.SendAsync(subscription, "Hello user's service worker!", CancellationToken.None);

🛠️ Contribution

Contributions are welcome! Feel free to:

  • Report bugs 🐛
  • Suggest features 💡
  • Submit pull requests 🔄

About

Simple WebPush .NET client

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages