Implementation of the Notification API in C# for Microsoft Blazor.
Install-Package Append.Blazor.Notifications
There is a sample application in /docs folder which is also hosted as documentation.
For some other references of what the API does see the example demo
Scoped by default.
public void ConfigureServices(IServiceCollection services)
{
services.AddNotifications();
}
@using Append.Blazor.Notifications
@inject INotificationService NotificationService
or
[Inject] private INotificationService _notificationService { get; set; }
bool IsSupportedByBrowser = await NotificationService.IsSupportedByBrowserAsync()
PermissionType permission = await NotificationService.RequestPermissionAsync();
PermissionType permission = NotificationService.PermissionStatus;
await NotificationService.CreateAsync("Title", "Description", "images/github.png");
NotificationOptions options = new NotificationOptions
{
Body = body,
Icon = icon,
};
await NotificationService.CreateAsync(title, options);
Please feel free to use the component, open issues, fix bugs or provide feedback.
This project is created and maintained by: