앱 알림은 텍스트, 이미지 및 단추/입력이 있는 유연한 알림입니다. 이 문서에서는 앱 알림에서 사용할 수 있는 UI 요소에 대해 설명하고 앱 알림에 대한 XML 형식을 생성하기 위한 코드 예제를 제공합니다.
참고
'알림 메시지'라는 용어가 '앱 알림'으로 대체됩니다. 이러한 용어는 모두 Windows의 동일한 기능을 참조하지만 시간이 지남에 따라 설명서에서 '알림 메시지'의 사용을 단계적으로 중단합니다.
시작
앱 알림은 앱 알림 스키마에 의해 정의된 XML 페이로드로 정의됩니다. 현재 앱 알림에 대한 XML 페이로드를 생성하는 세 가지 방법이 있습니다. 이 문서의 코드 예시에서는 다음 세 가지 방법을 모두 설명합니다.
Microsoft.Windows.AppNotifications.Builder API - Windows 앱 SDK 1.2에서 도입된 이 네임스페이스는 XML 형식의 세부 사항에 대해 걱정할 필요 없이 프로그래밍 방식으로 알림에 대한 XML 페이로드를 쉽게 빌드할 수 있는 API를 제공합니다. 이러한 API를 사용하는 코드 예시는 'Windows 앱 SDK'라는 레이블이 지정된 탭에 있습니다.
Microsoft.Toolkit.Uwp.Notifications 작성기 구문 - 이러한 API는 UWP 커뮤니티 도구 키트의 일부이며 UWP 앱에 대한 지원을 제공합니다. 이러한 API는 Windows App SDK 앱에도 사용할 수 있으며 계속 지원되지만 새 구현에서는Microsoft.Windows.AppNotifications.Builder API를 사용하는 것이 좋습니다. 커뮤니티 도구 키트 API를 사용하려면 UWP 커뮤니티 도구 키트 알림 넛지 패키지를 프로젝트에 추가합니다. 이 문서에서 제공하는 C# 샘플은 NuGet 패키지 버전 7.0.0을 사용합니다. 이러한 API를 사용하는 코드 예시는 'Windows 커뮤니티 도구 키트'라는 레이블이 지정된 탭에 있습니다.
원시 XML - 원하는 경우 필요한 형식으로 XML 문자열을 생성하는 사용자 지정 코드를 만들 수 있습니다. 원시 XML 예시는 'XML'이라는 레이블이 지정된 탭에 있습니다.
알림 시각화 도우미를 설치합니다. 이 무료 Windows 앱은 Visual Studio의 XAML 편집기/설계 보기와 비슷하게 알림을 편집할 때 시각적 미리 보기를 곧바로 제공하여 대화형 앱 알림을 설계하는 데 도움이 됩니다. 자세한 내용은 알림 비주얼라이저를 참조하거나 Microsoft Store에서 알림 비주얼라이저를 다운로드하세요.
이 문서에서는 앱 알림 콘텐츠 생성에 대해서만 다룹니다. XML 페이로드를 생성한 후 알림을 보내는 방법에 대한 자세한 내용은 로컬 앱 알림 보내기를 참조하세요.
앱 알림 구조
앱 알림 XML 페이로드의 중요한 상위 수준 구성 요소는 다음과 같습니다.
toast: 이 요소의 launch 특성은 사용자가 알림을 클릭할 때 앱으로 다시 전달될 인수를 정의하여 알림이 표시한 올바른 콘텐츠로 딥 링크할 수 있도록 합니다. 자세한 내용은 로컬 앱 알림 보내기를 참조하세요.
visual: 이 요소는 텍스트와 이미지가 포함된 일반 바인딩을 포함하여 알림의 시각적 부분을 나타냅니다.
특성 영역은 앱 알림의 맨 위에 있습니다. Windows 11부터 앱의 이름과 아이콘이 이 영역에 표시됩니다. 또한 특성 영역에는 사용자가 알림을 빠르게 해제할 수 있는 닫기 버튼과 사용자가 앱에 대한 알림을 신속하게 사용하지 않도록 설정하거나 앱 알림의 Windows 설정 페이지로 이동하도록 허용하는 더보기 메뉴가 포함되어 있습니다. 특성 영역은 셸에 의해 구성되며, 앱이 특성 영역 상황에 맞는 메뉴에 항목을 추가할 수 있지만 알림 XML 페이로드에서는 재정의할 수 없습니다. 자세한 내용은 컨텍스트 메뉴 동작을 참조하세요.
시각적 개체
각 앱 알림은 일반 알림 바인딩을 제공해야 하고 텍스트와 이미지를 포함할 수 있는 시각적 요소를 지정해야 합니다. 이러한 요소는 데스크톱, 전화, 태블릿 및 Xbox를 포함한 다양한 Windows 디바이스에서 렌더링됩니다.
각 앱 알림에는 하나 이상의 text 요소가 있어야 하며, 모두 AdaptiveText 형식인 두 개의 추가 텍스트 요소를 포함할 수 있습니다.
Windows 10주년 업데이트 이후로 텍스트에 HintMaxLines 속성을 사용하여 표시되는 텍스트 줄 수를 제어할 수 있습니다. 기본 및 최대값은 제목에서 최대 텍스트 2줄이고 추가 설명 요소 2개(두 번째와 세 번째 AdaptiveText)에서 최대 4줄(결합됨)입니다.
var builder = new AppNotificationBuilder()
.AddArgument("conversationId", 9813)
.AddText("Adaptive Tiles Meeting", new AppNotificationTextProperties().SetMaxLines(1))
.AddText("Conf Room 2001 / Building 135")
.AddText("10:00 AM - 10:30 AM");
var builder = new ToastContentBuilder()
.AddArgument("meetingId", 9813)
.AddText("Adaptive Tiles Meeting", hintMaxLines: 1)
.AddText("Conf Room 2001 / Building 135")
.AddText("10:00 AM - 10:30 AM");
var builder = new AppNotificationBuilder()
.AddText("Featured image of the day.")
.SetInlineImage(new Uri("ms-appx:///Images/InlineImage.png"));
AppNotificationManager.Default.Show(builder.BuildNotification());
var builder = new ToastContentBuilder()
.AddText("Featured image of the day.")
.AddInlineImage(new Uri("ms-appx:///Images/InlineImage.png"));
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Featured image of the day.</text>
<image src='ms-appx:///Images/InlineImage.png'/>
</binding>
</visual>
</toast>
앱 로고 재정의
배치 값을 'appLogoOverride'로 지정하면 시각적 영역 왼쪽의 사각형에 이미지가 표시됩니다. 이 속성의 이름은 이미지가 기본 앱 로고 이미지를 대체하는 이전 버전의 Windows의 동작을 반영합니다. Windows 11에서는 앱 로고가 특성 영역에 표시되므로 appLogoOverride 이미지 배치에 의해 재정의되지 않습니다.
이미지 치수는 100% 배율에서 48x48픽셀입니다. 일반적으로 각 배율에 대한 각 아이콘 자산(100%, 125%, 150%, 200%, 400%)의 버전을 제공하는 것이 좋습니다.
var builder = new AppNotificationBuilder()
.AddText("Matt sent you a friend request")
.AddText("Hey, wanna dress up as wizards and ride around on hoverboards?")
.SetAppLogoOverride(new Uri("ms-appx:///Images/Profile.png"), AppNotificationImageCrop.Circle);
var builder = new ToastContentBuilder()
.AddText("Matt sent you a friend request")
.AddText("Hey, wanna dress up as wizards and ride around on hoverboards?")
.AddAppLogoOverride(new Uri("ms-appx:///Images/Profile.png"), ToastGenericAppLogoCrop.Circle);
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Matt sent you a friend request</text>
<text>Hey, wanna dress up as wizards and ride around on hoverboards?</text>
<image placement='appLogoOverride' src='ms-appx:///Images/Profile.png' hint-crop='circle'/>
</binding>
</visual>
</toast>
영웅 이미지
기념일 업데이트의 새로운 기능: 앱 알림은 알림 배너 내와 알림 센터 내에서 눈에 띄게 표시되는 추천 ToastGenericHeroImage인 히어로 이미지를 표시할 수 있습니다. 이미지 치수는 100% 배율에서 364x180픽셀입니다.
var builder = new AppNotificationBuilder()
.AddText("Marry Anne")
.AddText("Check out where we camped last night!")
.SetHeroImage(new Uri("ms-appx:///Images/HeroImage.png"));
new ToastContentBuilder()
.AddText("Marry Anne")
.AddText("Check out where we camped last night!")
.AddHeroImage(new Uri("ms-appx:///Images/HeroImage.png"));
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Mary Anne</text>
<text>Check out where we camped last night!</text>
<image placement='hero' src='ms-appx:///Images/HeroImage.png'/>
</binding>
</visual>
</toast>
이미지 크기 제한
알림 메시지에서 사용하는 이미지는 다음 위치에서 소싱될 수 있습니다.
http://
ms-appx:///
ms-appdata:///
Http 및 https 원격 웹 이미지의 경우 각 개별 이미지의 파일 크기 제한이 있습니다. Fall Creators Update(16299)에서 일반 연결의 경우 이 제한을 3MB로 높이고 데이터 통신 연결의 경우 1MB로 높였습니다. 그 전에 이미지는 항상 200KB로 제한되었습니다.
일반 연결
데이터 통신 연결
Fall Creators Update 이전
3MB
1MB
200KB
이미지가 파일 크기를 초과하거나 다운로드하지 못하는 경우 이 이미지는 삭제되고 나머지 알림이 표시됩니다.
특성 텍스트
1주년 업데이트의 새로운 기능: 콘텐츠의 소스를 참조해야 하는 경우 특성 텍스트를 사용할 수 있습니다. 이 텍스트는 항상 모든 텍스트 요소 아래에 표시되지만 인라인 이미지 위에 표시됩니다. 텍스트는 표준 텍스트 요소보다 약간 작은 크기를 사용하여 일반 텍스트 요소와 구별할 수 있습니다.
특성 텍스트를 지원하지 않는 더 오래된 버전의 Windows에서는 텍스트가 다른 텍스트 요소로 표시됩니다. 단, 최대 3개의 텍스트 요소가 아직 없어야 합니다.
var builder = new AppNotificationBuilder()
.AddText("Marry Anne")
.AddText("Check out where we camped last night!")
.SetAttributionText("via SMS");
.SetHeroImage(new Uri("ms-appx:///Images/HeroImage.png"));
new ToastContentBuilder()
.AddText("Marry Anne")
.AddText("Check out where we camped last night!")
.AddAttributionText("Via SMS");
.AddHeroImage(new Uri("ms-appx:///Images/HeroImage.png"));
<toast>
<visual>
<binding template="ToastGeneric">
<image src="ms-appx:///Images/HeroImage.png"/>
<text>Mary Anne</text>
<text>Check out where we camped last night!</text>
<text placement="attribution">Via SMS</text>
</binding>
</visual>
</toast>
사용자 지정 타임스탬프
크리에이터 업데이트의 새로운 기능: 이제 시스템에서 제공하는 타임스탬프를 메시지/정보/콘텐츠 생성 시기를 정확하게 나타내는 타임스탬프로 재정의할 수 있습니다. 이 타임스탬프는 알림 센터 내에서 볼 수 있습니다.
var builder = new AppNotificationBuilder()
.AddText("Matt sent you a friend request")
.AddText("Hey, wanna dress up as wizards and ride around on hoverboards?")
.SetTimeStamp(new DateTime(2017, 04, 15, 19, 45, 00, DateTimeKind.Utc));
var builder = new ToastContentBuilder()
.AddText("Matt sent you a friend request")
.AddText("Hey, wanna dress up as wizards and ride around on hoverboards?")
.AddCustomTimeStamp(new DateTime(2017, 04, 15, 19, 45, 00, DateTimeKind.Utc));
<toast displayTimestamp='2017-04-15T12:45:00-07:00'>
<visual>
<binding template='ToastGeneric'>
<text>Matt sent you a friend request</text>
<text>Hey, wanna dress up as wizards and ride around on hoverboards?</text>
</binding>
</visual>
</toast>
진행률 표시줄
Creators Update의 새로운 기능: 앱 알림에 진행률 표시줄을 제공하여 사용자에게 다운로드와 같은 작업 진행 상황을 지속적으로 알릴 수 있습니다.
// The Microsoft.Windows.AppNotifications.Builder syntax does not currently support adaptive text elements.
new ToastContentBuilder()
...
.AddVisualChild(new AdaptiveGroup()
{
Children =
{
new AdaptiveSubgroup()
{
Children =
{
new AdaptiveText()
{
Text = "52 attendees",
HintStyle = AdaptiveTextStyle.Base
},
new AdaptiveText()
{
Text = "23 minute drive",
HintStyle = AdaptiveTextStyle.CaptionSubtle
}
}
},
new AdaptiveSubgroup()
{
Children =
{
new AdaptiveText()
{
Text = "1 Microsoft Way",
HintStyle = AdaptiveTextStyle.CaptionSubtle,
HintAlign = AdaptiveTextAlign.Right
},
new AdaptiveText()
{
Text = "Bellevue, WA 98008",
HintStyle = AdaptiveTextStyle.CaptionSubtle,
HintAlign = AdaptiveTextAlign.Right
}
}
}
}
});
버튼을 사용하면 대화형 알림을 생성하여 사용자가 현재 워크플로우를 중단하지 않고도 앱 알림에 대해 빠른 조치를 취할 수 있습니다. 예를 들어, 사용자가 알림 내에서 직접 메시지에 회신하거나 전자 메일 앱을 열지 않고도 전자 메일을 삭제할 수 있습니다. 앱단추는 알림의 확장된 부분에 표시됩니다.
앱은 포그라운드에서 활성화되며 특정 페이지/컨텍스트로 이동하는 데 사용할 수 있는 인수가 있습니다.
다른 앱은 프로토콜 시작을 통해 활성화됩니다.
백그라운드 활성화는 UWP 앱에 대해 명시적으로 지원됩니다. Windows App SDK 앱의 경우 앱은 항상 포그라운드에서 시작됩니다. 앱은 AppInstance.GetActivatedEventArgs를 호출하여 알림에 의해 활성화가 시작되었는지 감지하고 전달된 인수에서 포그라운드 앱을 완전히 시작할지 아니면 알림을 처리하고 종료할지 결정할 수 있습니다.
알림 다시 알림 또는 해제와 같은 시스템 작업은 UWP 앱과 Windows App SDK 모두 지원됩니다. AppNotificationBuilder API는 이 시나리오를 지원하지 않지만 Windows App SDK 앱은 Microsoft.Windows.AppNotifications.Builder API 또는 원시 XML을 사용하여 이 시나리오를 구현할 수 있습니다.
new ToastContentBuilder()
var builder = new AppNotificationBuilder()
.AddText("New product in stock!")
.AddButton(new AppNotificationButton("See more details")
.AddArgument("action", "viewDetails"))
.AddArgument("contentId", "351")
.AddButton(new AppNotificationButton("Remind me later")
.AddArgument("action", "remindLater"))
.AddArgument("contentId", "351");
var builder = new ToastContentBuilder()
.AddText("New product in stock!")
.AddButton(new ToastButton()
.SetContent("See more details")
.AddArgument("action", "viewDetails"))
.AddButton(new ToastButton()
.SetContent("Remind me later")
.AddArgument("action", "remindLater"));
<toast>
<visual>
<binding template='ToastGeneric'>
<text>New product in stock!</text>
</binding>
</visual>
<actions>
<action content='See more details' arguments='action=viewDetails;contentId=351'/>
<action content='Remind me later' arguments='action=remindLater;contentId=351'/>
</actions>
</toast>
아이콘이 있는 단추
단추에 아이콘을 추가할 수 있습니다. 이 아이콘은 100% 배율에 흰색 투명 16 x 16 픽셀 이미지이며 이미지 자체에 안쪽 여백이 없습니다. 알림 메시지에서 아이콘을 제공할 경우 단추 스타일을 아이콘 버튼으로 변형하기 때문에 알림에서 단추 전체에 아이콘을 제공해야 합니다.
참고
접근성을 위해서는 대비되는 흰색 버전의 아이콘(흰색 배경에 검정색 아이콘)을 포함해야만 사용자가 고대비 흰색 모드를 켤 때 아이콘이 잘 보입니다. 자세한 정보는 언어, 배율, 고대비에 대한 타일 및 알림 메시지 지원을 참조하세요.
Windows 11 업데이트의 새로운 기능: XML의 HintToolTip 속성을 사용하여 아이콘에 도구 설명을 추가할 수 있습니다. 이는 버튼에 아이콘이 있지만 콘텐츠가 없는 경우에 이상적입니다. 따라서 Windows Narrator가 읽을 수 있는 텍스트를 전달할 수 있습니다. 그러나 콘텐츠가 있는 경우 Narrator는 도구 설명에 전달되는 내용에 관계없이 콘텐츠를 읽습니다.
var button = new AppNotificationButton("Reply")
.AddArgument("action", "reply");
if (AppNotificationButton.IsToolTipSupported())
{
button.ToolTip = "Click to reply.";
}
var builder = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(button);
// The Community Toolkit builder syntax does not currently support icon tooltips.
var builder = new AppNotificationBuilder()
.AddText("Camping this weekend?")
.SetAppLogoOverride(new Uri("ms-appx:///images/Reply.png"), AppNotificationImageCrop.Circle)
.AddButton(new AppNotificationButton("Mute group chat for 1 hour")
.AddArgument("action", "mute")
.SetContextMenuPlacement());
Windows 커뮤니티 도구 키트 작성기 구문은 현재 상황에 맞는 메뉴 작업을 지원하지 않으므로 이니셜라이저 구문을 사용하는 것이 좋습니다.
ToastContent content = new ToastContent()
{
...
Actions = new ToastActionsCustom()
{
ContextMenuItems =
{
new ToastContextMenuItem("Mute group chat for 1 hour", "action=muteId")
}
}
};
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Camping this weekend?</text>
<image placement='appLogoOverride' src='ms-appx:///images/Reply.png' hint-crop='circle'/>
</binding>
</visual>
<actions>
<action content='Mute group chat for 1 hour' arguments='action=mute' placement='contextMenu'/>
</actions>
</toast>
참고
추가 바로 가기 메뉴 항목은 알림에서 총 5개 버튼 한도에 기여합니다.
추가 바로 가기 메뉴 항목의 활성화는 알림 단추와 동일하게 처리됩니다.
입력
입력은 앱 알림의 Actions 영역 내에서 지정되며, 이는 알림이 확장될 때만 표시된다는 것을 의미합니다.
빠른 회신 텍스트 상자
빠른 답장 텍스트 상자(예: 메시징 앱)를 활성화하려면 텍스트 입력과 버튼을 추가하고 텍스트 입력 필드의 ID를 참조하여 버튼이 입력 필드 옆에 표시되도록 합니다. 버튼의 선택적 아이콘(제공된 경우)은 안쪽 여백이 없는 32x32픽셀 이미지여야 하며, 흰색 픽셀은 투명으로 설정되고, 배율은 100%여야 합니다.
var builder = new AppNotificationBuilder()
.AddTextBox("textBox", "Type a reply", "Reply")
.AddButton(AppNotificationButton("Send")
.AddArguments("action", "Send")
.SetInputId("textBox"))
.BuildNotification();
var builder = new ToastContentBuilder()
.AddInputTextBox("tbReply", "Type a reply")
.AddButton(new ToastButton()
.SetContent("Reply")
.SetTextBoxId("tbReply") // To place button next to text box, reference text box's id
.SetImageUri(new Uri("Assets/Reply.png", UriKind.Relative))
.AddArgument("action", "reply"));
<toast launch="app-defined-string">
<visual>
<binding template="ToastGeneric">
<image placement="appLogoOverride" hint-crop="circle" src="https://picsum.photos/48?image=883"/>
<text>Andrew Bares</text>
<text>Shall we meet up at 8?</text>
</binding>
</visual>
<actions>
<input id="textBox" type="text" placeHolderContent="Type a reply"/>
<action
content="Send"
arguments="action=reply&convId=9318"
hint-inputId="textBox"
imageUri="Assets/Reply.png"/>
</actions>
</toast>
var builder = new AppNotificationBuilder()
.AddText("4th coffee?")
.AddText("When do you plan to come in tomorrow?")
.AddComboBox(new AppNotificationComboBox("time")
.SetTitle("Select an item:")
.AddItem("breakfast", "Breakfast")
.AddItem("lunch", "Lunch")
.AddItem("dinner", "Dinner")
.SetSelectedItem("lunch"))
.AddButton(new AppNotificationButton("Reply")
.AddArgument("action", "reply")
.AddArgument("threadId", "9218")
.SetContextMenuPlacement())
.AddButton(new AppNotificationButton("Call restaurant")
.AddArgument("action", "videocall")
.AddArgument("threadId", "9218")
.SetContextMenuPlacement());
var builder = new ToastContentBuilder()
.AddText("4th coffee?")
.AddText("When do you plan to come in tomorrow?")
.AddToastInput(new ToastSelectionBox("time")
{
DefaultSelectionBoxItemId = "lunch",
Items =
{
new ToastSelectionBoxItem("breakfast", "Breakfast"),
new ToastSelectionBoxItem("lunch", "Lunch"),
new ToastSelectionBoxItem("dinner", "Dinner")
}
})
.AddButton(new ToastButton()
.SetContent("Reply")
.AddArgument("action", "reply")
.AddArgument("threadId", "9218"))
.AddButton(new ToastButton()
.SetContent("Call restaurant")
.AddArgument("action", "videoCall")
.AddArgument("threadId", "9218"));
<toast>
<visual>
<binding template='ToastGeneric'>
<text>4th coffee?</text>
<text>When do you plan to come in tomorrow?</text>
</binding>
</visual>
<actions>
<input id='time' type='selection' title='Select an item:' defaultInput='lunch'>
<selection id='breakfast' content='Breakfast'/><selection id='dinner' content='Dinner'/>
<selection id='lunch' content='Lunch'/>
</input>
<action content='Reply' arguments='action=reply;threadId=9218' placement='contextMenu'/>
<action content='Call Restaurant' arguments='action=videocall;threadId=9218' placement='contextMenu'/>
</actions>
</toast>
다시 알림/해제
선택 메뉴와 2개의 단추를 사용하여 시스템 다시 알림 및 해제 작업을 활용하는 미리 알림을 만들 수 있습니다. 미리 알림처럼 작동하도록 알림에 대해 시나리오를 '미리 알림'으로 설정합니다.
알림 단추에 SelectionBoxId 속성을 사용하여 선택 메뉴 입력에 다시 알림 단추를 연결합니다.
Microsoft.Windows.AppNotifications.Builder 구문은 현재 시스템 활성화를 지원하지 않습니다. 그러나 이 시나리오는 Windows App SDK 앱에서 지원되며 Microsoft.Toolkit.Uwp.Notifications API 또는 원시 XML을 사용하여 이 시나리오에 대한 알림을 빌드할 수 있습니다.
// The Microsoft.Windows.AppNotifications.Builder syntax does not currently support system activation.
// But this scenario is supported for Windows App SDK apps, and you can build notifications for this
// scenario using the `Microsoft.Toolkit.Uwp.Notifications` APIs or raw XML.
new ToastContentBuilder()
.SetToastScenario(ToastScenario.Reminder)
...
.AddToastInput(new ToastSelectionBox("snoozeTime")
{
DefaultSelectionBoxItemId = "15",
Items =
{
new ToastSelectionBoxItem("5", "5 minutes"),
new ToastSelectionBoxItem("15", "15 minutes"),
new ToastSelectionBoxItem("60", "1 hour"),
new ToastSelectionBoxItem("240", "4 hours"),
new ToastSelectionBoxItem("1440", "1 day")
}
})
.AddButton(new ToastButtonSnooze() { SelectionBoxId = "snoozeTime" })
.AddButton(new ToastButtonDismiss());
문자열을 제공하지 않는 경우 "다시 알림" 및 "해제"에 대해 지역화된 문자열을 자동으로 사용합니다.
필요에 따라 SelectionBoxId를 지정합니다.
사용자가 다시 알림 간격을 선택하지 않고 시스템 정의 시간 간격(OS 간에 일관된 시간 간격)에 대해 알림을 한 번만 다시 알림을 보내도록 하려면 <입력>을 전혀 생성하지 마십시오.
다시 알림 간격 선택을 제공하려는 경우: - 스누즈 작업에서 SelectionBoxId 지정 - 입력 ID를 스누즈 작업의 SelectionBoxId 일치 - ToastSelectionBoxItem의 값을 분 단위로 다시 알림 간격을 나타내는 nonNegativeInteger로 지정
오디오
사용자 지정 오디오는 모바일에서 항상 지원되었으며 데스크톱 버전 1511(빌드 10586) 이상에서 지원됩니다. 사용자 지정 오디오는 다음 경로에서 참조할 수 있습니다.
var builder = new AppNotificationBuilder()
.AddText("Notification text.")
.SetAudioEvent(AppNotificationSoundEvent.Alarm, AppNotificationAudioLooping.Loop);
var builder = new ToastContentBuilder()
.AddText("Notification text")
.AddAudio(new Uri("ms-winsoundevent:Notification.Looping.Alarm"));
앱 알림의 오디오에 대한 자세한 내용은 오디오 스키마 페이지를 참조하세요. 사용자 지정 오디오를 사용하는 앱 알림을 보내는 방법을 알아보려면 알림의 사용자 지정 오디오를 참조하세요.
시나리오
중요한 알림, 알람, 미리 알림 및 수신 전화 알림을 만들려면 Scenario 값이 할당된 일반 앱 알림을 사용하기만 하면 됩니다. 이 시나리오는 일관되고 통합된 사용자 환경을 만들기 위해 몇 가지 동작을 조정합니다. 다음과 같은 4가지 Scenario 값이 있습니다.
미리 알림
경보
IncomingCall
긴급
미리 알림
미리 알림 시나리오에서 알림은 사용자가 해제하거나 조치를 취할 때까지 화면에 유지됩니다. Windows Mobile에서는 앱 알림도 미리 확장된 상태로 표시됩니다. 미리 알림 소리가 재생됩니다. 앱 알림에 하나 이상의 버튼을 제공해야 합니다. 그렇지 않으면 알림이 일반 알림으로 처리됩니다.
var builder = new AppNotificationBuilder()
.AddText("Adaptive Tiles Meeting",
new AppNotificationTextProperties()
.SetMaxLines(1))
.AddText("Conf Room 2001 / Building 135")
.AddText("10:00 AM - 10:30 AM");
if (AppNotificationBuilder.IsUrgentScenarioSupported())
{
builder.SetScenario(AppNotificationScenario.Urgent);
}
// The builder syntax does not support important notifications yet.
Some Power Automate button flows allow for user input and runs a predefined series of actions. This type of flow button provides the input that is necessary to run the predefined actions in the flow. It shows users how they can create a flow button that runs different logic based on the provided inputs.