@amirsavand/ngx-common - v5.1.0
    Preparing search index...

    Class NotificationBaseService

    Handling browser desktop notification API.

    Index

    Constructors

    Properties

    showNotificationRequest: BehaviorSubject<boolean>

    Whether to show user that they have not allowed notifications yet.

    Only true when user has not denied or granted notification permission.

    supported: boolean

    Flag for whether notifications are supported on this device.

    window: Window

    Accessors

    • get isGranted(): boolean

      Returns boolean

      Whether notification permission is granted on this device.

    • get permission(): NotificationPermission

      Returns NotificationPermission

      Notification permission on this device.

    Methods

    • Requests permission from the user to display desktop notifications.

      Returns Observable<NotificationPermission>

      An observable that resolves to the notification permission status.

    • Displays a desktop notification with the provided options.

      Parameters

      • title: string

        The title of the notification.

      • Optionaloptions: NotificationOptions

        Configuration options for the notification (optional).

      • OptionalonClick: () => void

        Callback function to execute when the notification is clicked (optional).

      Returns null | Notification