-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Extend WebPushMessage with the custom settings #20304
base: main
Are you sure you want to change the base?
Conversation
30e4ad4
to
0fa84bf
Compare
To note: I'm working on figuring out how can we provide an API for adding action listener, else than asking to extend the service worker (sw.js). Also this needs some testing on mobile. |
* @param options any Serializable Java Object representing custom settings that you want to apply to the notification | ||
* @see <a href=https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#parameters</a> | ||
*/ | ||
public WebPushMessage(String title, Serializable options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider providing a proper java class / record for the options instead of just Serializable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I didn't add a class for options if because otherwise we should extend or modify it each time when the browser API changed. IMO it's better to decouple the Java API from the browser API that way.
Quality Gate passedIssues Measures |
Description
Adds an API to set custom options as described in https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#parameters
Fixes #20285
Type of change
Checklist
Additional for
Feature
type of change