A product registered in the store. More...
Header: | #include <QInAppProduct> |
Inherits: | QObject |
enum | ProductType { Consumable, Unlockable } |
|
|
QString | description() const |
QString | identifier() const |
QString | price() const |
QInAppProduct::ProductType | productType() const |
virtual void | purchase() = 0 |
QString | title() const |
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.
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(). |
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.
Access functions:
QString | description() const |
This property holds the identifier of the product. It matches the identifier which is registered in the external store.
Access functions:
QString | identifier() const |
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.
Access functions:
QString | price() const |
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.
Access functions:
QInAppProduct::ProductType | productType() const |
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.
Access functions:
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also QInAppTransaction.