The consume callback.
- Parameters
-
consumed | The quantity of product consumed. |
error | The error description if the process fails. |
The fetch callback.
- Parameters
-
products | The fetched products. |
error | The error description if the process fails. |
The purchase callback.
- Parameters
-
purchase | The purchase information. |
error | The error description if the process fails. |
The restore callback.
- Parameters
-
error | The error description if the process fails. |
Defines the validation completion.
- Parameters
-
receipt | The receipt. |
productId | The id of the product. |
completion | Completion. |
Defines the validation handler.
- Parameters
-
receipt | The receipt. |
productId | The id of the product. |
completion | Completion. |
Adds an Inapp observer to the process.
- Parameters
-
observer | An InApp observer. |
virtual bool ludei::inapps::InAppService::canPurchase |
( |
| ) |
const |
|
pure virtual |
Resturs YES if the service is available
- Returns
- True if the service is available and False otherwise.
virtual void ludei::inapps::InAppService::consume |
( |
const string & |
productId, |
|
|
int32_t |
quantity, |
|
|
const ConsumeCallback & |
callback |
|
) |
| |
|
pure virtual |
Consumes a consumable item.
- Parameters
-
productId | The id of the product. |
quantity | The quantity. |
callback | The ConsumeCallback. |
static InAppService* ludei::inapps::InAppService::create |
( |
InAppProvider |
provider = InAppProvider::AUTO | ) |
|
|
static |
Creates a new InAppService
- Parameters
-
provider | The InApp Provider that will be used or AUTO to automatically select the one linked within the binary |
- Returns
- The InAppService with the selected provider or NULL if the provider is not available
static InAppService* ludei::inapps::InAppService::create |
( |
const char * |
className | ) |
|
|
static |
Creates a new InAppService
- Parameters
-
className | The className of the provider |
- Returns
- The InAppService with the selected provider or NULL if the provider is not available
virtual void ludei::inapps::InAppService::fetchProducts |
( |
const std::vector< string > & |
productIds, |
|
|
const FetchCallback & |
callback |
|
) |
| |
|
pure virtual |
Requests information about products from the remote Store. Products are cached in a local DB (
- See also
- getProducts)
- Parameters
-
productIds | The ids of all the fetched products. |
callback | The FetchCallback. |
virtual void ludei::inapps::InAppService::finishPurchase |
( |
const string & |
transactionId | ) |
|
|
pure virtual |
Removes a finished purchase transaction from the queue.
- Parameters
-
transactionId | Transaction id. |
virtual std::vector<InAppProduct> ludei::inapps::InAppService::getProducts |
( |
| ) |
const |
|
pure virtual |
Returns the cached products.
- Returns
- The products.
virtual bool ludei::inapps::InAppService::isPurchased |
( |
const string & |
productId | ) |
const |
|
pure virtual |
Check if a product has been previously purchased.
- Parameters
-
productId | the id of the product. |
- Returns
- True if the product has been purchased and false otherswise.
virtual void ludei::inapps::InAppService::mapProductIds |
( |
const std::map< string, string > & |
productsMap | ) |
|
|
pure virtual |
Asociates an alias to each productId.
- Parameters
-
productsMap | The map containing the aliases as keys and the real productId as values. |
virtual bool ludei::inapps::InAppService::productForId |
( |
const string & |
productId, |
|
|
InAppProduct * |
product |
|
) |
| const |
|
pure virtual |
Gets a product given its id.
- Parameters
-
productId | The id of the product. |
product | The product returned by reference |
- Returns
- True if the products exits.
virtual void ludei::inapps::InAppService::purchase |
( |
const string & |
productId, |
|
|
int32_t |
quantity, |
|
|
const PurchaseCallback & |
callback |
|
) |
| |
|
pure virtual |
Purchases a quantity of a specific product.
- Parameters
-
productId | The id of the product. |
quantity | The quantity. |
callback | The PurchaseCallback |
void ludei::inapps::InAppService::purchase |
( |
const string & |
productId, |
|
|
const PurchaseCallback & |
callback |
|
) |
| |
|
inline |
Purchases a product.
- Parameters
-
productId | The id of the product. |
callback | The PurchaseCallback. |
Removes an Inapp observer from the process.
- Parameters
-
observer | An InApp observer. |
virtual void ludei::inapps::InAppService::restorePurchases |
( |
const RestoreCallback & |
callback | ) |
|
|
pure virtual |
Restores already completed transactions and purchases.
- Parameters
-
callback | The RestoreCallback. |
virtual void ludei::inapps::InAppService::setLudeiServerValidationHandler |
( |
| ) |
|
|
pure virtual |
Use Ludei's server to validate purchases. To enable validation using Ludei's server you first need to create an account in Ludei's Cloud server and create a project with you bundleId.
virtual void ludei::inapps::InAppService::setValidationHandler |
( |
const ValidationHandler & |
handler | ) |
|
|
pure virtual |
Sets a custom purchase validation handler. Purchases are always validated to TRUE by default. Set a custom validation handler to use you own custom server to validate purchases.
- Parameters
-
handler | The validation handler. |
virtual void ludei::inapps::InAppService::start |
( |
| ) |
|
|
pure virtual |
Starts the service. You should call this method when your InAppPurchaseObservers are already registered.
virtual int32_t ludei::inapps::InAppService::stockOfProduct |
( |
const string & |
productId | ) |
|
|
pure virtual |
Returns the stock of a product given its id.
- Parameters
-
productId | The id of the product to check. |
- Returns
- The stock of the given product.
The documentation for this class was generated from the following file: