Skip to content

FR: Add a way inside the ServiceWorker to prevent Notifications from showing automatically  #6821

Open
@IlyasDiker

Description

@IlyasDiker

[REQUIRED] Describe your environment

  • Operating System version: MacOs
  • Browser version: Version 107.0.5304.110 (Official Build) (x86_64)
  • Firebase SDK version: 9.13.0
  • Firebase Product: Cloud Messaging
  • Are you an idiot: No (Maybe)

[REQUIRED] Describe the problem

messages with {notification: { ... }, data: {...}} are shown automatically from the service worker i would like to prevent showing some notifications automatically from the service worker.

on the documentation it says :

onBackgroundMessage (display notification automatically shown)

my question is just why forcing the notification to be shown automatically, and not adding a way to prevent the default behavior.

(if the answer is go change the payload and don't send notification:{...} send just data (i'm already aware about this) it's not possible in my case.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions