QInAppProduct Class
A product registered in the store 更多...
头文件: | #include <QInAppProduct> |
基类: | QObject |
公有类型
enum | ProductType { Consumable, Unlockable } |
属性
|
|
- 1 个属性继承自 QObject
公有函数
QString | description() const |
QString | identifier() const |
QString | price() const |
ProductType | productType() const |
virtual void | purchase() = 0 |
QString | title() const |
- 32 个公有函数继承自 QObject
其他继承的成员
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
A product registered in the store
QInAppProduct encapsulates a product in the external store after it has been registered in QInAppStore
and confirmed to exist. It has an identifier which matches the identifier of the product in the external store, it has a price which is retrieved from the external store, and it has a product type.
The product type can be either Consumable
or Unlockable
. The former type of products can be purchased any number of times as long as each transaction is finalized explicitly by the application. The latter type can only be purchased once.
成员类型
enum QInAppProduct::ProductType
This enum type is used to specify the product type when registering the product.
Constant | Value | Description |
---|---|---|
QInAppProduct::Consumable | 0 | The product is consumable, meaning that once the transaction for a purchase of the product has been finalized, it can be purchased again. |
QInAppProduct::Unlockable | 1 | The product is unlockable, meaning that it can only be purchased once per user. Purchases of unlockable products can be restored using the QInAppStore::restorePurchases(). |
属性
description : const QString
This property holds the description of the product as reported by the external store. This description is returned from the store in the locale language if available.
访问函数:
QString | description() const |
identifier : const QString
This property holds the identifier of the product. It matches the identifier which is registered in the external store.
访问函数:
QString | identifier() const |
price : const QString
This property holds the price of the product as reported by the external store. This is the full price including currency, usually in the locale of the current user.
访问函数:
QString | price() const |
productType : const ProductType
This property holds the type of the product. This can either be Consumable
or Unlockable
. The former are products which can be purchased any number of times (granted that each transaction is explicitly finalized by the application first) and the latter are products which can only be purchased once per user.
访问函数:
ProductType | productType() const |
title : const QString
This property holds the title of the product as reported by the external store. This title is returned from the store in the locale language if available.
访问函数:
QString | title() const |
成员函数
[pure virtual]
void QInAppProduct::purchase()
Launches the purchase flow for this product. The purchase is done asynchronously. When the purchase has either been completed successfully or failed for some reason, the QInAppStore instance containing this product will emit a QInAppStore::transactionReady() signal with information about the transaction.