PushNotificationChannelManagerForUser クラス

定義

Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得するために使用するオブジェクトを作成します。 これらのチャネルは、アプリまたは セカンダリ タイルを介して現在のユーザーにバインドされます。

public ref class PushNotificationChannelManagerForUser sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PushNotificationChannelManagerForUser final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PushNotificationChannelManagerForUser final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PushNotificationChannelManagerForUser
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PushNotificationChannelManagerForUser
Public NotInheritable Class PushNotificationChannelManagerForUser
継承
Object Platform::Object IInspectable PushNotificationChannelManagerForUser
属性

Windows の要件

デバイス ファミリ
Windows 10 Anniversary Edition (10.0.14393.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v3.0 で導入)

次の例は、 CreatePushNotificationChannelForApplicationAsync メソッドを使用して、呼び出し元アプリのプッシュ通知チャネルを取得する方法を示しています。

var pushNotifications = Windows.Networking.PushNotifications;
var channel;

function openNotificationsChannel() {
    var channelOperation = pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForApplicationAsync();
    return channelOperation.then(function (newChannel) {
        channel = newChannel;
    }
);

次の例は、 CreatePushNotificationChannelForSecondaryTileAsync メソッドを使用して、セカンダリ タイルのプッシュ通知チャネルを取得する方法を示しています。

var pushNotifications = Windows.Networking.PushNotifications;
var channel;

pushNotifications.PushNotificationChannelManagerForUser.createPushNotificationChannelForSecondaryTileAsync(myTileId).then(function (channel) {
    // Your code here.
})

注釈

このクラスにはコンストラクターがありません。 使用法の詳細については、例に関するセクションを参照してください。

バージョン履歴

Windows のバージョン SDK バージョン 追加された値
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String)
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String,String)

プロパティ

User

ユーザーを取得します。

メソッド

CreatePushNotificationChannelForApplicationAsync()

呼び出し元アプリにバインドされた オブジェクトを作成します。このオブジェクトを使用して、Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得します。

CreatePushNotificationChannelForApplicationAsync(String)

Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得する、指定したアプリにバインドされた オブジェクトを作成します。 指定したアプリは、呼び出し元アプリと同じパッケージに含まれている必要があります。

CreatePushNotificationChannelForSecondaryTileAsync(String)

セカンダリ タイルにバインドされたオブジェクトを作成します。このオブジェクトを使用して、Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得します。 このタイルには、呼び出し元アプリのセカンダリ タイル、または同じパッケージ内の他のアプリを指定できます。

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得する、指定したアプリにバインドされたオブジェクトを作成します。 指定したアプリは、呼び出し元アプリと同じパッケージに含まれている必要があります。

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

Windows プッシュ通知サービス (WNS) からプッシュ通知チャネルを取得する、指定したアプリにバインドされたオブジェクトを作成します。 指定したアプリは、呼び出し元アプリと同じパッケージに含まれている必要があります。

適用対象