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

Use AppNotificationManager instead of ToastNotificationManager #900

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

VladislavAntonyuk
Copy link
Collaborator

@VladislavAntonyuk VladislavAntonyuk commented Jan 17, 2023

Description of Change

Update Toast Windows to use the new API AppNotificationManager as Microsoft recommends: https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/adaptive-interactive-toasts?tabs=appsdk

PR Checklist

Additional information

@VladislavAntonyuk VladislavAntonyuk requested a review from a team January 17, 2023 08:51
@VladislavAntonyuk VladislavAntonyuk self-assigned this Jan 17, 2023
jfversluis
jfversluis previously approved these changes Jan 17, 2023
Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

Couple of very minor things! The actual code looks good to me!

Co-authored-by: Gerald Versluis <gerald@verslu.is>
Copy link
Member

@pictos pictos left a comment

Choose a reason for hiding this comment

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

I've just a few comments. And should be good to go.

src/CommunityToolkit.Maui/Alerts/Toast/Toast.shared.cs Outdated Show resolved Hide resolved
src/CommunityToolkit.Maui/Alerts/Toast/Toast.shared.cs Outdated Show resolved Hide resolved
src/CommunityToolkit.Maui/Alerts/Toast/Toast.windows.cs Outdated Show resolved Hide resolved
@VladislavAntonyuk VladislavAntonyuk enabled auto-merge (squash) January 17, 2023 15:58
@VladislavAntonyuk VladislavAntonyuk merged commit 4ea771f into main Jan 17, 2023
@VladislavAntonyuk VladislavAntonyuk deleted the Toast-Use-New-API branch January 17, 2023 17:27
string text = string.Empty;
string actionButtonText = AlertDefaults.ActionButtonText;
readonly string text = string.Empty;
readonly string actionButtonText = AlertDefaults.ActionButtonText;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool!! I didn't know that we could use readonly fields in get; init; properties!

I like it. It makes a lot of sense 💯

/// </summary>
/// <param name="text">Notification text</param>
/// <returns><see cref="XmlDocument"/></returns>
public static XmlDocument BuildToastNotificationContent(string text)
Copy link
Collaborator

@brminnick brminnick Jan 17, 2023

Choose a reason for hiding this comment

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

FYI - this is technically a breaking change, removing a public API

We'll need to bump our Major version number for our next release (which'll hopefully coincide with the release of MediaPlayer)

Copy link
Collaborator

Choose a reason for hiding this comment

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

That being said, I'd be surprised if removing this API impacts any devs

Choose a reason for hiding this comment

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

How start coding

@HASSA17Y
Copy link

@

@CommunityToolkit CommunityToolkit locked as resolved and limited conversation to collaborators Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants