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 を使用すると、既定のブラウザーで Web サイトを起動したり、登録された URI スキームを持つアプリを起動したりできます。 URI を使用してアプリを起動する方法の詳細については、「URI を使用 してアプリを起動する」を参照してください。

呼び出し URI または TargetAppId を設定する必要がありますが、両方は設定しないでください。 両方を設定すると、システムは TargetAppId を使用します。

AppNotificationButton.SetInvokeUri を呼び出すことで、アプリ通知ボタンの呼び出し URI を設定することもできます。

AppNotificationBuilder API を使用してアプリ通知用の UI を作成する方法については、「アプリ通知コンテンツ」を参照してください。

アプリ通知の XML スキーマのリファレンス情報については、「アプリ 通知コンテンツ スキーマ」を参照してください。

適用対象