Skip to content

SwPush.messages and SwPush.notificationClicks don't work properly on iOS #54014

@StefanNedelchev

Description

@StefanNedelchev

Which @angular/* package(s) are the source of the bug?

service-worker

Is this a regression?

No

Description

The messages Observable from SwPush doesn't seem to emit anything when using Push API on iOS. The notifications are correctly set up (and they work) but comparing Windows, Android and iOS side by side shows that only iOS doesn't receive updates on SwPush.messages.
SwPush.notificationClicks does work but only when the app is closed and you swipe right on the notification to activate the "open" option. Tapping on the notification (or swiping right) while the client app is actively running doesn't make notificationClicks to emit.

Please provide a link to a minimal reproduction of the bug

https://github.com/StefanNedelchev/ng-web-push

Please provide the exception or error you saw

No errors are being thrown in the process.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.2.0
Node: 20.11.1
Package Manager: npm 10.4.0
OS: linux x64

Angular: 17.2.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1702.0
@angular-devkit/build-angular   17.2.0
@angular-devkit/core            17.2.0
@angular-devkit/schematics      17.2.0
@angular/cli                    17.2.0
@schematics/angular             17.2.0
rxjs                            7.8.1
typescript                      5.3.3
zone.js                         0.14.4

Anything else?

The repo for reproduction is also deployed here https://ng-web-push-example.netlify.app for testing (check the readme for explanation). I'm testing this on a real iPhone with iOS v17.2.1 (latest at the moment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: service-workerIssues related to the @angular/service-worker packageiOSIssue related to Apple's iOS operating system

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions