QInAppProduct Class

A product registered in the store 更多...

頭: #include <QInAppProduct>
繼承: QObject

公共類型

enum ProductType { Consumable, Unlockable }

特性

公共函數

QString description () const
QString 標識符 () const
QString price () const
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.

成員類型文檔編製

enum QInAppProduct:: ProductType

This enum type is used to specify the product type when registering the product.

常量 描述
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 描述 () const

標識符 : const QString

This property holds the identifier of the product. It matches the identifier which is registered in the external store.

訪問函數:

QString 標識符 () 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.

另請參閱 QInAppTransaction .