ProductLicense Classe

Définition

Fournit des informations sur une licence associée à un module complémentaire (également appelé produit in-app ou IAP).

public ref class ProductLicense sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ProductLicense final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ProductLicense
Public NotInheritable Class ProductLicense
Héritage
Object Platform::Object IInspectable ProductLicense
Attributs

Configuration requise pour Windows

Famille d’appareils
Windows 10 (introduit dans 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduit dans v1.0)

Exemples

L’exemple de code suivant montre comment utiliser cet objet pour obtenir la date d’expiration d’une offre complémentaire.

// get the license info for this app from the simulator
LicenseInformation licenseInformation = CurrentAppSimulator.LicenseInformation;

// get the license info for one of the app's in-app offers
ProductLicense inAppOfferLicense =
    licenseInformation.ProductLicenses["MyFavoriteInAppOffer"];

// get the expiration date of this in-app offer
DateTimeOffset expirationDate = inAppOfferLicense.ExpirationDate;

Remarques

La propriété ProductLicenses de l’objet LicenseInformation contient une ou plusieurs instances de cet objet.

Propriétés

ExpirationDate

Obtient la date et l’heure d’expiration actuelles de la licence du module complémentaire (également appelée produit in-app ou IAP).

IsActive

Indique si la licence du module complémentaire (également appelée produit in-app ou IAP) est actuellement active.

IsConsumable

Indique si le module complémentaire (également appelé produit in-app ou IAP) est consommable. Un module complémentaire consommable peut être acheté, utilisé et acheté à nouveau.

ProductId

Obtient l’ID d’un module complémentaire (également appelé produit in-app ou IAP). Cet ID est utilisé par l’application pour obtenir des informations sur le produit ou la fonctionnalité activé lorsque le client l’achète par le biais d’un achat dans l’application.

S’applique à

Voir aussi