vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
619 stars 167 forks source link

Make WebPushMessage output customisable #20285

Closed caalador closed 1 week ago

caalador commented 3 weeks ago

Describe your motivation

Make the content of WebPushMessage more customizable to enable giving options outside of only title and body.

{
  "//": "Visual Options",
  "body": "<String>",
  "icon": "<URL String>",
  "image": "<URL String>",
  "badge": "<URL String>",
  "dir": "<String of 'auto' | 'ltr' | 'rtl'>",
  "timestamp": "<Long>"

  "//": "Both visual & behavioral options",
  "actions": "<Array of Strings>",
  "data": "<Anything>",

  "//": "Behavioral Options",
  "tag": "<String>",
  "requireInteraction": "<boolean>",
  "renotify": "<Boolean>",
  "vibrate": "<Array of Integers>",
  "sound": "<URL String>",
  "silent": "<Boolean>",
}

Describe the solution you'd like

Add a customParameters field to the record that is used for the resulting json.

Describe alternatives you've considered

Make WebPushMessage a class so it can be extended.