Skip to content
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: Web Push Options #3889

Merged
merged 10 commits into from
Nov 12, 2024
Merged

feat: Web Push Options #3889

merged 10 commits into from
Nov 12, 2024

Conversation

mshabarov
Copy link
Contributor

Documents vaadin/flow#20285.

@github-actions github-actions bot added the Language unchecked English language check has not been done label Nov 8, 2024
Comment on lines 304 to 327
[source,java]
----
WebPushAction webPushAction = new WebPushAction("dashboard", "Open Dashboard");
WebPushOptions webPushOptions = new WebPushOptions(
body,
List.of(webPushAction),
"This is my data",
"https://example.com/my-icon.png"
);
webPush.sendNotification(subscription, new WebPushMessage(title, webPushOptions));
----

`WebPushAction` and `WebPushOptions` records are not part of the Vaadin Web Push API and must be defined within the project.

[source,java]
----
public record WebPushAction(String action, String title) implements Serializable {
}
public record WebPushOptions(String body,
List<WebPushAction> actions,
Serializable data,
String icon) implements Serializable {
}
----
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would perhaps have these in the reverse order so that the record definitions are shown first to not create confusion on where these are available.
So say for the following records [sample records] they can be used as [sample creation]....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, done.

@russelljtdyer russelljtdyer added Language checking English language checking is in progress and removed Language unchecked English language check has not been done labels Nov 12, 2024
@russelljtdyer russelljtdyer added Language checked English language check done and removed Language checking English language checking is in progress labels Nov 12, 2024
@russelljtdyer russelljtdyer merged commit dc82a32 into latest Nov 12, 2024
3 of 4 checks passed
@russelljtdyer russelljtdyer deleted the web-push-options branch November 12, 2024 09:22
@jouni
Copy link
Member

jouni commented Nov 18, 2024

Could we still rename the file from setting-up-webpush.adoc to webpush.adoc? Do we foresee the need to reserve that path for some other web-push-related content?

@mshabarov
Copy link
Contributor Author

webpush.adoc can be used instead, I see no problems.

@jouni
Copy link
Member

jouni commented Nov 18, 2024

Thanks. I’ll update it. I assume there shouldn't be too many links to this pages out in the wild, so we won't need any redirect rules for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language checked English language check done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants