Skip to content

Process to allow transforming push notification before it is displayed #60609

@ettubrute47

Description

@ettubrute47

Which @angular/* package(s) are relevant/related to the feature request?

service-worker

Description

I appreciate the hooks for displaying push notifications already, but if I want to modify the content of the notification before showing it, I don't think I have a way to do that without changing the worker.

My use case is in a web app testing the extent of E2EE - threat model assumes read-access to server db, client schedules a push notification, contents encrypted to the server, which schedules it when time comes. On receipt, client needs to be able to decrypt the content before passing to normal 'showNotification' flow.

Proposed solution

The simplest solution in my mind would be a callback that allows you to modify the notification payload before continuing to show it. Part of SwPush, though itd have to run when application is closed so Im not sure that would work. An even better solution would be to officially support extending the service worker module, as there are other issues with specific service worker niche use cases that could be solved by just supporting service worker extensions.

Alternatives considered

Manually updating service worker or adding custom service worker with importScripts. Fragile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: service-workerIssues related to the @angular/service-worker package

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions