diff --git a/dev/AppNotifications/AppNotificationBuilder/AppNotificationBuilder.cpp b/dev/AppNotifications/AppNotificationBuilder/AppNotificationBuilder.cpp index 910846470e..ee6fb284a7 100644 --- a/dev/AppNotifications/AppNotificationBuilder/AppNotificationBuilder.cpp +++ b/dev/AppNotifications/AppNotificationBuilder/AppNotificationBuilder.cpp @@ -215,7 +215,6 @@ namespace winrt::Microsoft::Windows::AppNotifications::Builder::implementation ThrowIfMaxInputItemsExceeded(); THROW_HR_IF_MSG(E_INVALIDARG, id.empty(), "You must provide an id for the TextBox"); - m_textBoxList.push_back(wil::str_printf(L"", EncodeXml(id).c_str())); return *this; } @@ -370,27 +369,23 @@ namespace winrt::Microsoft::Windows::AppNotifications::Builder::implementation winrt::Microsoft::Windows::AppNotifications::AppNotification AppNotificationBuilder::BuildNotification() { - // Build the button string and fill m_useButtonStyle + // Build the actions string and fill m_useButtonStyle std::wstring actions{ GetActions() }; - auto xmlResult{ wil::str_printf(L"%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls%ls", - L"(L"%ls%ls%ls%ls%ls%ls", m_timeStamp.c_str(), GetDuration().c_str(), GetScenario().c_str(), GetArguments().c_str(), GetButtonStyle().c_str(), - L">", GetText().c_str(), m_attributionText.c_str(), GetImages().c_str(), GetProgressBars().c_str(), - L"", m_audio.c_str(), - actions.c_str(), - L"") }; + actions.c_str()) }; - THROW_HR_IF_MSG(E_INVALIDARG, xmlResult.size() > c_maxAppNotificationPayload, "Maximum payload size exceeded"); + THROW_HR_IF_MSG(E_FAIL, xmlResult.size() > c_maxAppNotificationPayload, "Maximum payload size exceeded"); winrt::Microsoft::Windows::AppNotifications::AppNotification appNotification{ xmlResult }; appNotification.Tag(m_tag); diff --git a/dev/AppNotifications/AppNotificationBuilder/AppNotificationProgressBar.cpp b/dev/AppNotifications/AppNotificationBuilder/AppNotificationProgressBar.cpp index 39002ae4ea..b9cbdd0e08 100644 --- a/dev/AppNotifications/AppNotificationBuilder/AppNotificationProgressBar.cpp +++ b/dev/AppNotifications/AppNotificationBuilder/AppNotificationProgressBar.cpp @@ -105,7 +105,7 @@ namespace winrt::Microsoft::Windows::AppNotifications::Builder::implementation auto valueStringOverride{ wil::str_printf < std::wstring>(L" valueStringOverride='%ls'", m_valueStringOverrideBindMode == BindMode::Value ? m_valueStringOverride.c_str() : L"{progressValueString}") }; return wil::str_printf(L"", - m_titleBindMode == BindMode::NotSet ? L"" :title.c_str(), + m_titleBindMode == BindMode::NotSet ? L"" : title.c_str(), status.c_str(), value.c_str(), m_valueStringOverrideBindMode == BindMode::NotSet ? L"" : valueStringOverride.c_str()).c_str(); diff --git a/test/AppNotificationBuilderTests/APITests.cpp b/test/AppNotificationBuilderTests/APITests.cpp index 78df89afa0..9946fcaf02 100644 --- a/test/AppNotificationBuilderTests/APITests.cpp +++ b/test/AppNotificationBuilderTests/APITests.cpp @@ -426,7 +426,7 @@ namespace Test::AppNotification::Builder { VERIFY_THROWS_HR(winrt::AppNotificationBuilder() .AddText(std::wstring(5120, 'A').c_str()) - .BuildNotification(), E_INVALIDARG); + .BuildNotification(), E_FAIL); } TEST_METHOD(AppNotificationAddProgressBar) diff --git a/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj b/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj index 2d92e195b0..f3362b9279 100644 --- a/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj +++ b/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj @@ -153,4 +153,4 @@ - \ No newline at end of file + diff --git a/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj.filters b/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj.filters index bb2b67149b..79f9f60b84 100644 --- a/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj.filters +++ b/test/AppNotificationBuilderTests/AppNotificationBuilderTests.vcxproj.filters @@ -28,4 +28,4 @@ Header Files - \ No newline at end of file +