Share via


ProductLicense クラス

定義

アドオン (アプリ内製品または 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
継承
Object Platform::Object IInspectable ProductLicense
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

次のコード例では、このオブジェクトを使用してアドオン オファーの有効期限を取得する方法を示します。

// 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;

注釈

LicenseInformation オブジェクトの ProductLicenses プロパティには、このオブジェクトの 1 つ以上のインスタンスが含まれています。

プロパティ

ExpirationDate

アドオン (アプリ内製品または IAP とも呼ばれます) ライセンスの現在の有効期限の日付と時刻を取得します。

IsActive

アドオン (アプリ内製品または IAP とも呼ばれます) ライセンスが現在アクティブかどうかを示します。

IsConsumable

アドオン (アプリ内製品または IAP とも呼ばれます) が使用できるかどうかを示します。 コンシューマブル アドオンは、購入、使用、再購入が可能です。

ProductId

アドオンの ID (アプリ内製品または IAP とも呼ばれます) を取得します。 この ID は、アプリ内購入を通じて顧客が購入したときに有効になる製品または機能に関する情報を取得するためにアプリによって使用されます。

適用対象

こちらもご覧ください