다음을 통해 공유


AppNotificationButton.InvokeUri 속성

정의

앱 알림 단추를 클릭할 때 시작되는 URI를 가져오거나 설정합니다.

public:
 property Uri ^ InvokeUri { Uri ^ get(); void set(Uri ^ value); };
Uri InvokeUri();

void InvokeUri(Uri value);
public System.Uri InvokeUri { get; set; }
var uri = appNotificationButton.invokeUri;
appNotificationButton.invokeUri = uri;
Public Property InvokeUri As Uri

속성 값

호출할 URI 를 지정하는 Uri 개체입니다.

예제

다음 예제에서는 앱 알림 단추에 대한 호출 URI를 설정하기 위해 이 속성을 사용하는 방법을 보여 줍니다.

var button = new AppNotificationButton("Launch URI")
    .AddArgument("action", "info");
button.InvokeUri = new Uri("https://learn.microsoft.com");

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(button)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='' arguments='https://learn.microsoft.com/' activationType='protocol'/>
    </actions>
</toast>

설명

URI를 사용하여 기본 브라우저에서 웹 사이트를 시작하거나 등록된 URI 체계가 있는 앱을 시작할 수 있습니다. URI를 사용하여 앱을 시작하는 방법에 대한 자세한 내용은 URI를 사용하여 앱 시작을 참조하세요.

호출 URI 또는 TargetAppId를 설정해야 하지만 둘 다 설정하지는 않습니다. 둘 다 설정하면 시스템에서 TargetAppId를 사용합니다.

AppNotificationButton.SetInvokeUri를 호출하여 앱 알림 단추에 대한 호출 URI를 설정할 수도 있습니다.

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

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

적용 대상