Title: Add `notificationCloses` to `SwPush` · Issue #52244 · angular/angular · GitHub
Open Graph Title: Add `notificationCloses` to `SwPush` · Issue #52244 · angular/angular
X Title: Add `notificationCloses` to `SwPush` · Issue #52244 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? service-worker Description Angular official documentation page says: When using the Angular service worker, push notification interactions are handled using the SwP...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? service-worker Description Angular official documentation page says: When using the Angular service worker, push notificatio...
X Description: Which @angular/* package(s) are relevant/related to the feature request? service-worker Description Angular official documentation page says: When using the Angular service worker, push notificatio...
Opengraph URL: https://github.com/angular/angular/issues/52244
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `notificationCloses` to `SwPush`","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\r\n\r\nservice-worker\r\n\r\n### Description\r\n\r\nAngular official [documentation page](https://angular.io/guide/service-worker-notifications) says:\r\n> When using the Angular service worker, push notification interactions are handled using the [SwPush](https://angular.io/api/service-worker/SwPush) service. To learn more about the browser APIs involved see [Push API](https://developer.mozilla.org/docs/Web/API/Push_API) and [Using the Notifications API](https://developer.mozilla.org/docs/Web/API/Notifications_API/Using_the_Notifications_API).\r\n\r\nThe SwPush service contains [notificationClicks](https://angular.io/guide/service-worker-notifications#notification-click-handling) property to handle [serviceWorkerGlobalScope.notificationclick](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/notificationclick_event).\r\n\r\nBut `serviceWorkerGlobalScope` also emits [notificationclose](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/notificationclose_event) event. \r\n\r\n### Proposed solution\r\n\r\nAdd `notificationCloses` property to `SwPush` service.\r\n\r\n**Proposed steps:**\r\n* Add `this.scope.addEventListener('notificationclose', (event) => this.onClose(event!));` (similar to already existed `notificationclick` event)\r\nhttps://github.com/angular/angular/blob/634c5295045d66cf1e8be0e5f384a848b18cf0f8/packages/service-worker/worker/src/driver.ts#L172\r\n* Add `this.notificationCloses = this.sw.eventsOfType('NOTIFICATION_CLOSE')` (similar to already existed `NOTIFICATION_CLICK`)\r\nhttps://github.com/angular/angular/blob/634c5295045d66cf1e8be0e5f384a848b18cf0f8/packages/service-worker/src/push.ts#L148-L149\r\n\r\n### Alternatives considered\r\n\r\n\\-","author":{"url":"https://github.com/nsbarsukov","@type":"Person","name":"nsbarsukov"},"datePublished":"2023-10-17T13:53:47Z","url":"https://github.com/angular/angular/issues/52244"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:36338377-f482-8826-2687-40be91c7278b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93C6:E9D16:3F28A8:4FBEB4:6B0107A9 |
| html-safe-nonce | 9e543ea4ff52fecbac1456baf4e459318b7ddebed53ba42b8f39ab3433443144 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0M2OkU5RDE2OjNGMjhBODo0RkJFQjQ6NkIwMTA3QTkiLCJ2aXNpdG9yX2lkIjoiMzE4MjEzODUzNTUwNzQ2MjA1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 328b1722f6c1db06995203e55e4e8efa04b8e20e5c95b2e120ee3bd97aedc202 |
| hovercard-subject-tag | issue:1947493442 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/52244/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8ac8eede0c93ec36662a23d20a1289182b2efa56f2c705d8fcbd0fade453ad0a/angular/angular/issues/52244 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8ac8eede0c93ec36662a23d20a1289182b2efa56f2c705d8fcbd0fade453ad0a/angular/angular/issues/52244 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? service-worker Description Angular official documentation page says: When using the Angular service worker, push notificatio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nsbarsukov |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width