Share via


AppNotificationBuilder.IsUrgentScenarioSupported 메서드

정의

현재 디바이스에서 긴급 앱 알림 시나리오가 지원되는지 여부를 나타내는 값을 반환합니다.

public:
 static bool IsUrgentScenarioSupported();
 static bool IsUrgentScenarioSupported();
public static bool IsUrgentScenarioSupported();
function isUrgentScenarioSupported()
Public Shared Function IsUrgentScenarioSupported () As Boolean

반환

Boolean

bool

True이면 현재 디바이스가 긴급 앱 알림 시나리오를 지원합니다. 그렇지 않으면 false입니다.

예제

다음 예제에서는 긴급 앱 알림 시나리오가 지원되는지 확인하는 방법을 보여 줍니다.

var builder = new AppNotificationBuilder()
    .AddText("Notification text.");

if (AppNotificationBuilder.IsUrgentScenarioSupported())
{
    builder.SetScenario(AppNotificationScenario.Urgent);
}

AppNotificationManager.Default.Show(builder.BuildNotification());

긴급 시나리오가 지원되는 경우 결과 XML 페이로드:

<toast scenario='urgent'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

AppNotificationBuilder.SetScenario 메서드를 사용하면 AppNotificationScenario 열거형의 시나리오 중 하나를 지정할 수 있으므로 시스템에서 일부 알림 동작을 조정하여 지정된 시나리오에 대한 일관된 환경을 표시할 수 있습니다. 긴급 시나리오 값은 Windows 10 빌드 19041 이상에서만 지원됩니다. 이 메서드를 사용하면 현재 디바이스에서 긴급 시나리오가 지원되는지 런타임에 확인할 수 있습니다.

AppNotificationBuilder API를 사용하여 앱 알림에 대한 UI를 만드는 방법에 대한 지침은 앱 알림 콘텐츠를 참조하세요.

앱 알림에 대한 XML 스키마에 대한 참조 정보는 앱 알림 콘텐츠 스키마를 참조하세요.

적용 대상