Notification


How to use the Notification class of the bit Butil?

Usage
To use the browser notification features you need to inject the Bit.Butil.Notification class and use it like this:
@inject Bit.Butil.Notification notification

@code {
    await notification.IsSupported();
    await notification.Show("title", new() { Body = "this is body." });
}
Methods

IsSupported:
Checks if the runtime (browser or web-view) is supporting the Web Notification API.



GetPermission:
Gets the current permission of the Notification API. (MDN).



RequestPermission:
Requests permission from the user for the current origin to display notifications. (MDN).



Show:
Requests a native notification to show to the user. (MDN).
Note: The Notification api has some limitation on Android and for it to work properly a Service Worker needs to be registered first.