Condividi tramite


PushNotificationChannelManagerForUser Classe

Definizione

Crea oggetti usati per recuperare i canali di notifica push da Windows Push Notification Services (WNS). Questi canali sono associati all'utente corrente tramite un'app o un riquadro secondario.

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
Ereditarietà
Object Platform::Object IInspectable PushNotificationChannelManagerForUser
Attributi

Requisiti Windows

Famiglia di dispositivi
Windows 10 Anniversary Edition (è stato introdotto in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v3.0)

Esempio

Nell'esempio seguente viene illustrato l'uso del metodo CreatePushNotificationChannelForApplicationAsync per recuperare un canale di notifica push per l'app chiamante.

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

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

Nell'esempio seguente viene illustrato l'uso del metodo CreatePushNotificationChannelForSecondaryTileAsync per recuperare un canale di notifica push per un riquadro secondario.

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

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

Commenti

Questa classe non dispone di un costruttore. Per altre informazioni sull'utilizzo, vedere la sezione degli esempi.

Cronologia delle versioni

Versione di Windows Versione dell'SDK Valore aggiunto
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String)
1703 15063 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer,String,String)

Proprietà

User

Ottiene l'utente.

Metodi

CreatePushNotificationChannelForApplicationAsync()

Crea un oggetto, associato all'app chiamante, tramite cui si recupera un canale di notifica push da Windows Push Notification Services (WNS).

CreatePushNotificationChannelForApplicationAsync(String)

Crea un oggetto, associato a un'app specificata, tramite cui si recupera un canale di notifica push da Servizi notifica push Windows (WNS). L'app specificata deve trovarsi nello stesso pacchetto dell'app chiamante.

CreatePushNotificationChannelForSecondaryTileAsync(String)

Crea un oggetto, associato a un riquadro secondario, tramite il quale si recupera un canale di notifica push da Windows Push Notification Services (WNS). Il riquadro può essere un riquadro secondario dell'app chiamante o qualsiasi altra app nello stesso pacchetto.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

Crea un oggetto associato a un'app specificata tramite cui si recupera un canale di notifica push da Windows Push Notification Services (WNS). L'app specificata deve trovarsi nello stesso pacchetto dell'app chiamante.

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

Crea un oggetto associato a un'app specificata tramite cui si recupera un canale di notifica push da Windows Push Notification Services (WNS). L'app specificata deve trovarsi nello stesso pacchetto dell'app chiamante.

Si applica a