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

testing changes #4894

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions WindowsAppRuntime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IXP", "IXP", "{7B323048-439
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IXP.TransportPackage.PackageReference", "eng\PackageReference\IXP\IXP.TransportPackage.PackageReference.csproj", "{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notifications", "Notifications", "{43FE6980-3E16-4EF9-A3DE-29B402FB4FAB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BaseNotifications", "BaseNotifications", "{586EA218-74C8-420B-B47E-0B307AA4B82D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BadgeNotifications", "BadgeNotifications", "{50205ED9-0E08-4878-B124-9AC0EBA138D6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BadgeNotifications", "dev\Notifications\BadgeNotifications\BadgeNotifications.vcxitems", "{85D111C7-B720-4E19-A56D-03C87B953983}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseNotifications", "dev\Notifications\BaseNotifications\BaseNotifications.vcxitems", "{2BD7A1BB-D3D8-484F-9180-409D781DCCF9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Windows.BadgeNotifications.Projection", "dev\Projections\CS\Microsoft.Windows.BadgeNotifications.Projection\Microsoft.Windows.BadgeNotifications.Projection.csproj", "{A243A58D-ABD7-4520-8C71-F492247B7B92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -2002,6 +2014,22 @@ Global
{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x64.Build.0 = Release|x64
{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x86.ActiveCfg = Release|x86
{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x86.Build.0 = Release|x86
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|ARM64.Build.0 = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|x64.ActiveCfg = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|x64.Build.0 = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|x86.ActiveCfg = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Debug|x86.Build.0 = Debug|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|Any CPU.Build.0 = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|ARM64.ActiveCfg = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|ARM64.Build.0 = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x64.ActiveCfg = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x64.Build.0 = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x86.ActiveCfg = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -2181,13 +2209,20 @@ Global
{D5958784-4518-44F1-A518-80514B380ED5} = {E24C263A-DE3E-4844-BA50-842DA5AD7A49}
{7B323048-439F-47E9-A3D4-7342C5ADE2A5} = {5C88AE1D-AC20-4A41-9299-1EEA15B80724}
{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB} = {7B323048-439F-47E9-A3D4-7342C5ADE2A5}
{43FE6980-3E16-4EF9-A3DE-29B402FB4FAB} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
{586EA218-74C8-420B-B47E-0B307AA4B82D} = {43FE6980-3E16-4EF9-A3DE-29B402FB4FAB}
{50205ED9-0E08-4878-B124-9AC0EBA138D6} = {43FE6980-3E16-4EF9-A3DE-29B402FB4FAB}
{85D111C7-B720-4E19-A56D-03C87B953983} = {50205ED9-0E08-4878-B124-9AC0EBA138D6}
{2BD7A1BB-D3D8-484F-9180-409D781DCCF9} = {586EA218-74C8-420B-B47E-0B307AA4B82D}
{A243A58D-ABD7-4520-8C71-F492247B7B92} = {716C26A0-E6B0-4981-8412-D14A4D410531}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
test\inc\inc.vcxitems*{08bc78e0-63c6-49a7-81b3-6afc3deac4de}*SharedItemsImports = 4
dev\PushNotifications\PushNotifications.vcxitems*{103c0c23-7ba8-4d44-a63c-83488e2e3a81}*SharedItemsImports = 9
dev\Notifications\BaseNotifications\BaseNotifications.vcxitems*{2bd7a1bb-d3d8-484f-9180-409d781dccf9}*SharedItemsImports = 9
dev\EnvironmentManager\API\Microsoft.Process.Environment.vcxitems*{2f3fad1b-d3df-4866-a3a3-c2c777d55638}*SharedItemsImports = 9
dev\OAuth\OAuth.vcxitems*{3e7fd510-8b66-40e7-a80b-780cb8972f83}*SharedItemsImports = 9
test\inc\inc.vcxitems*{412d023e-8635-4ad2-a0ea-e19e08d36915}*SharedItemsImports = 4
Expand All @@ -2198,6 +2233,7 @@ Global
test\inc\inc.vcxitems*{7c502995-59c3-483b-86ba-815985353633}*SharedItemsImports = 4
dev\ApplicationData\ApplicationData.vcxitems*{7cf52890-56fa-47e2-84fb-68ee274324b6}*SharedItemsImports = 9
dev\BackgroundTask\BackgroundTaskBuilder\BackgroundTaskBuilder.vcxitems*{858fa9a9-f822-4b98-84a1-fe44e2c00a5d}*SharedItemsImports = 9
dev\Notifications\BadgeNotifications\BadgeNotifications.vcxitems*{85d111c7-b720-4e19-a56d-03c87b953983}*SharedItemsImports = 9
dev\Common\Common.vcxitems*{8828053c-d6ec-4744-8624-f8c676c2d4df}*SharedItemsImports = 9
dev\Licensing\Licensing.vcxitems*{885a43fa-052d-4b0d-a2dc-13ee15796435}*SharedItemsImports = 9
dev\PackageManager\API\PackageManager.vcxitems*{8a9a0c85-65a8-4bca-a49e-45fc4fdbc7d2}*SharedItemsImports = 9
Expand Down
2 changes: 2 additions & 0 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppLifecycle.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.Builder.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.BadgeNotifications.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Management.Deployment.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Media.Capture.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.PushNotifications.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
Expand Down Expand Up @@ -200,6 +201,7 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppLifecycle.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.Builder.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.BadgeNotifications.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Management.Deployment.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Media.Capture.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.PushNotifications.winmd $NugetDir\lib\uap10.0
Expand Down
5 changes: 4 additions & 1 deletion build/NuSpecs/AppxManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" IgnorableNamespaces="uap build">
<Identity Name="Microsoft.WindowsAppRuntime.1.0" ProcessorArchitecture="x64" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="0.52102.3000.0" />
<Properties>
Expand Down Expand Up @@ -111,6 +111,9 @@

<!-- CameraCaptureUI -->
<ActivatableClass ActivatableClassId="Microsoft.Windows.Media.Capture.CameraCaptureUI" ThreadingModel="both" />

<!-- BadgeNotifications -->
<ActivatableClass ActivatableClassId="Microsoft.Windows.BadgeNotifications.BadgeNotificationManager" ThreadingModel="both" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.proxyStub">
Expand Down
6 changes: 6 additions & 0 deletions build/NuSpecs/WindowsAppSDK-Nuget-Native.WinRt.props
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
<Implementation Condition="'$(WindowsAppSDKFrameworkPackage)' != 'true'">$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="Microsoft.Windows.BadgeNotifications.winmd"
Condition="Exists('$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.BadgeNotifications.winmd')">
<HintPath>$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.BadgeNotifications.winmd</HintPath>
<Implementation Condition="'$(WindowsAppSDKFrameworkPackage)' != 'true'">$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.BadgeNotifications.winmd"
Condition="Exists('$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.BadgeNotifications.winmd')">
<Private>false</Private>
<Implementation>Microsoft.WindowsAppRuntime.dll</Implementation>
</Reference>
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)..\Microsoft.WindowsAppSDK.BootstrapCommon.targets" />
<Import Project="$(MSBuildThisFileDirectory)WindowsAppSDK-Nuget-Native.Bootstrap.targets" Condition="'$(WindowsAppSdkBootstrapInitialize)' == 'true'"/>

Expand Down
39 changes: 38 additions & 1 deletion dev/AppNotifications/NotificationProperties.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#include "pch.h"
Expand Down Expand Up @@ -47,6 +47,35 @@ NotificationProperties::NotificationProperties(winrt::AppNotification const& toa
{
m_toastProgressData = winrt::make_self<NotificationProgressData>(toastNotification.Progress());
}

m_notificationType = ToastABI::NotificationType::NotificationType_Toast;
}

NotificationProperties::NotificationProperties(Microsoft::Windows::BaseNotifications::BaseNotification const& baseNotification)
{
// Extract payload and convert it from XML to a byte array
auto payloadAsSimpleString = Helpers::WideStringToUtf8String(baseNotification.Payload());

m_payload = wil::unique_cotaskmem_array_ptr<byte>(static_cast<byte*>(CoTaskMemAlloc(payloadAsSimpleString.size())), payloadAsSimpleString.size());
THROW_IF_NULL_ALLOC(m_payload.get());
CopyMemory(m_payload.data(), payloadAsSimpleString.c_str(), payloadAsSimpleString.size());

m_notificationId = baseNotification.Id();

m_tag = baseNotification.Tag();
m_group = baseNotification.Group();

m_expiry = winrt::clock::to_file_time(baseNotification.Expiration());
m_arrivalTime = winrt::clock::to_file_time(winrt::clock::now());

m_expiresOnReboot = baseNotification.ExpiresOnReboot();

if (baseNotification.Progress() != nullptr)
{
m_toastProgressData = winrt::make_self<NotificationProgressData>(baseNotification.Progress());
}

m_notificationType = baseNotification.NotificationType();
}

STDMETHODIMP_(HRESULT __stdcall) NotificationProperties::get_NotificationId(_Out_ unsigned int* notificationId) noexcept
Expand Down Expand Up @@ -147,3 +176,11 @@ STDMETHODIMP_(HRESULT __stdcall) NotificationProperties::get_ActivityId(_Out_ GU
*activityId = GUID_NULL;
return S_OK;
}

STDMETHODIMP_(HRESULT __stdcall) NotificationProperties::get_NotificationType(_Out_ ToastABI::NotificationType* notificationType) noexcept
{
auto lock{ m_lock.lock_shared() };
*notificationType = m_notificationType;

return S_OK;
}
11 changes: 9 additions & 2 deletions dev/AppNotifications/NotificationProperties.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#pragma once

#include <frameworkUdk/ToastNotificationsRT.h>
#include "BaseNotification.h"

struct NotificationProperties : winrt::implements<NotificationProperties, ::ABI::Microsoft::Internal::ToastNotifications::INotificationProperties>
struct NotificationProperties : winrt::implements<NotificationProperties, ::ABI::Microsoft::Internal::ToastNotifications::INotificationProperties, ::ABI::Microsoft::Internal::ToastNotifications::INotificationProperties3>
{
NotificationProperties(winrt::Microsoft::Windows::AppNotifications::AppNotification const& toastNotification);

NotificationProperties(Microsoft::Windows::BaseNotifications::BaseNotification const& baseNotification);

STDMETHOD(get_NotificationId)(_Out_ unsigned int* notificationId) noexcept;

STDMETHOD(get_Payload)(_Out_ unsigned int* payloadSize, _Out_ byte** payload) noexcept;
Expand All @@ -31,6 +34,8 @@ struct NotificationProperties : winrt::implements<NotificationProperties, ::ABI:

STDMETHOD(get_ActivityId)(_Out_ GUID* activityId) noexcept;

STDMETHOD(get_NotificationType)(_Out_ ABI::Microsoft::Internal::ToastNotifications::NotificationType* notificationType) noexcept;

private:
wil::srwlock m_lock;

Expand All @@ -49,4 +54,6 @@ struct NotificationProperties : winrt::implements<NotificationProperties, ::ABI:
bool m_expiresOnReboot = false;

winrt::com_ptr<ABI::Microsoft::Internal::ToastNotifications::IToastProgressData> m_toastProgressData{ nullptr };

ABI::Microsoft::Internal::ToastNotifications::NotificationType m_notificationType;
};
12 changes: 11 additions & 1 deletion dev/AppNotifications/NotificationTransientProperties.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#include "pch.h"
Expand Down Expand Up @@ -28,6 +28,16 @@ NotificationTransientProperties::NotificationTransientProperties(winrt::AppNotif
}
}

NotificationTransientProperties::NotificationTransientProperties(_In_ Microsoft::Windows::BaseNotifications::BaseNotification const& baseNotification) noexcept
{
m_suppressPopup = baseNotification.SuppressDisplay();

if (baseNotification.Priority() == winrt::AppNotificationPriority::High)
{
m_toastNotificationPriority = ToastABI::ToastNotificationPriority::ToastNotificationPriority_High;
}
}

STDMETHODIMP_(HRESULT __stdcall) NotificationTransientProperties::get_OfflineCacheCount(_Out_ unsigned long long* offlineCacheCount) noexcept
{
*offlineCacheCount = 0;
Expand Down
5 changes: 4 additions & 1 deletion dev/AppNotifications/NotificationTransientProperties.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#pragma once

#include <frameworkUdk/ToastNotificationsRT.h>
#include "BaseNotification.h"

struct NotificationTransientProperties : winrt::implements<NotificationTransientProperties, ::ABI::Microsoft::Internal::ToastNotifications::INotificationTransientProperties>
{
NotificationTransientProperties(winrt::Microsoft::Windows::AppNotifications::AppNotification const& toastNotification) noexcept;

NotificationTransientProperties(Microsoft::Windows::BaseNotifications::BaseNotification const& baseNotification) noexcept;

STDMETHOD(get_OfflineCacheCount)(_Out_ unsigned long long* offlineCacheCount) noexcept;

STDMETHOD(get_OfflineBundleId)(_Out_ HSTRING* offlineBundleId) noexcept;
Expand Down
32 changes: 32 additions & 0 deletions dev/Common/TerminalVelocityFeatures-BadgeNotifications.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT IT

// INPUT FILE: dev\common\TerminalVelocityFeatures-BadgeNotifications.xml
// OPTIONS: -Channel Experimental -Language C++ -Namespace Microsoft.Windows.BadgeNotifications -Path dev\common\TerminalVelocityFeatures-BadgeNotifications.xml -Output dev\common\TerminalVelocityFeatures-BadgeNotifications.h

#if defined(__midlrt)
namespace features
{
feature_name Feature_BadgeNotifications = { DisabledByDefault, FALSE };
}
#endif // defined(__midlrt)

// Feature constants
#define WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_BADGENOTIFICATIONS_FEATURE_BADGENOTIFICATIONS_ENABLED 1

#if defined(__cplusplus)

namespace Microsoft::Windows::BadgeNotifications
{

__pragma(detect_mismatch("ODR_violation_WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_BADGENOTIFICATIONS_FEATURE_BADGENOTIFICATIONS_ENABLED_mismatch", "AlwaysEnabled"))
struct Feature_BadgeNotifications
{
static constexpr bool IsEnabled() { return WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_BADGENOTIFICATIONS_FEATURE_BADGENOTIFICATIONS_ENABLED == 1; }
};

} // namespace Microsoft.Windows.BadgeNotifications

#endif // defined(__cplusplus)
23 changes: 23 additions & 0 deletions dev/Common/TerminalVelocityFeatures-BadgeNotifications.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<features xmlns="http://microsoft.com/windowsappsdk/TerminalVelocity/20210729/TerminalVelocityFeatures.xsd">

<!-- Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See LICENSE in the project root for license information.

-->

<!-- See docs/Coding-Guidelines/TerminalVelocity.md for more info. -->

<!-- Enabled variants -->
<feature>
<name>Feature_BadgeNotifications</name>
<description>Enables Local Badge sourced Notifications for packaged apps on the device</description>
<state>AlwaysEnabled</state>
<alwaysDisabledChannelTokens>
<channelToken>Preview</channelToken>
<channelToken>Stable</channelToken>
</alwaysDisabledChannelTokens>
</feature>
</features>

27 changes: 27 additions & 0 deletions dev/Notifications/BadgeNotifications/BadgeNotification.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#include "pch.h"
#include "BadgeNotification.h"
#include <frameworkUdk/ToastNotificationsRT.h>

using namespace Microsoft::Windows::BaseNotifications;

namespace ToastABI
{
using namespace ::ABI::Microsoft::Internal::ToastNotifications;
}

namespace Microsoft::Windows::BadgeNotifications {
// Default constructor
BadgeNotification::BadgeNotification() : BaseNotification()
{
BaseNotification::NotificationType(ToastABI::NotificationType::NotificationType_Badge);
}

// Constructor that takes a payload and forwards it to the base class constructor
BadgeNotification::BadgeNotification(winrt::hstring const& payload) : BaseNotification(payload)
{
BaseNotification::NotificationType(ToastABI::NotificationType::NotificationType_Badge);
}
}
17 changes: 17 additions & 0 deletions dev/Notifications/BadgeNotifications/BadgeNotification.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#pragma once

#include <wil/resource.h>
#include "BaseNotification.h"


namespace Microsoft::Windows::BadgeNotifications
{
struct BadgeNotification : Microsoft::Windows::BaseNotifications::BaseNotification
{
BadgeNotification();
BadgeNotification(winrt::hstring const& payload);
};
}
Loading