Skip to content

arivera12/BlazorNotification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlazorNotification

Blazor browser notifications from c# without any JavaScript library or dependency.

Installation

Install-Package BlazorNotification -Version 1.0.1

Register the service in your services method

services.AddBlazorNotification();

No javascript library reference dependency

Usage

[Inject] IBlazorNotificationService BlazorNotificationService { get; set; }

Send a notification

Using a Function (basic)

await NotificationService.SendAsync("Title", "Description", "images/github.png");

Using NotificationOptions (advanced)

NotificationOptions options = new NotificationOptions
{
    Body = body,
    Icon = icon,
};

await NotificationService.SendAsync(title, options);

Browser Support

bool IsSupportedByBrowser = await NotificationService.IsSupportedByBrowserAsync()

Request Permission

PermissionType permission = await NotificationService.RequestPermissionAsync();

License

MIT

About

Blazor browser notifications from c# without any JavaScript library or dependency.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages