Blazor Class Library for sending Web Notifications
Add to Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddNotifications();
}
Add to Program.cs
public static async Task Main(string[] args)
{
builder.Services.AddNotifications();
}
Add to _Host.cshtml
<script src="_content/BlazorNotifications/notifier.js"></script>
Add to wwwroot/index.html
<script src="_content/BlazorNotifications/notifier.js"></script>
Add to your .razor file
@inject Blazor.Notifications.NotificationService NotificationService
Raise a notification
await NotificationService.CreateAsync("Hello from Blazor Notifier");