JUCE: InAppPurchases::Listener Struct Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
InAppPurchases::Listener Struct Reference
juce_product_unlocking » in_app_purchases

Represents an object that gets notified about events such as product info returned or product purchase finished. More...

`#include <juce_InAppPurchases.h>`

## Classes
struct | PurchaseInfo
| Structure holding purchase information. More...

## Public Member Functions
virtual | ~Listener ()
virtual void | productsInfoReturned (const Array< Product > &)
| Called whenever a product info is returned after a call to InAppPurchases::getProductsInformation().
virtual void | productPurchaseFinished (const PurchaseInfo &, bool, const String &)
| Called whenever a purchase is complete, with additional state whether the purchase completed successfully.
virtual void | purchasesListRestored (const Array< PurchaseInfo > &, bool, const String &)
| Called when a list of all purchases is restored.
virtual void | productConsumed (const String &, bool, const String &)
| Called whenever a product consumption finishes.
virtual void | productDownloadProgressUpdate (Download &, float, RelativeTime)
| iOS only: Called when a product download progress gets updated.
virtual void | productDownloadPaused (Download &)
| iOS only: Called when a product download is paused.
virtual void | productDownloadFinished (Download &, const URL &)
| iOS only: Called when a product download finishes (successfully or not).

## Detailed Description

Represents an object that gets notified about events such as product info returned or product purchase finished.

## Constructor & Destructor Documentation

## ◆ ~Listener()

virtual InAppPurchases::Listener::~Listener | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ productsInfoReturned()

virtual void InAppPurchases::Listener::productsInfoReturned | ( | const Array< Product > & |  | ) |
| virtual

Called whenever a product info is returned after a call to InAppPurchases::getProductsInformation().

## ◆ productPurchaseFinished()

virtual void InAppPurchases::Listener::productPurchaseFinished | ( | const PurchaseInfo & | ,
|  | bool | ,
|  | const String & | )
| virtual

Called whenever a purchase is complete, with additional state whether the purchase completed successfully.

For hosted content (iOS only), the downloads array within PurchaseInfo will contain all download objects corresponding with the purchase. For non-hosted content, the downloads array will be empty.

InAppPurchases class will own downloads and will delete them as soon as they are finished.

NOTE: It is possible to receive this callback for the same purchase multiple times. If that happens, only the newest set of downloads and the newest orderId will be valid, the old ones should be not used anymore!

## ◆ purchasesListRestored()

virtual void InAppPurchases::Listener::purchasesListRestored | ( | const Array< PurchaseInfo > & | ,
|  | bool | ,
|  | const String & | )
| virtual

Called when a list of all purchases is restored.

This can be used to figure out to which products a user is entitled.

NOTE: It is possible to receive this callback for the same purchase multiple times. If that happens, only the newest set of downloads and the newest orderId will be valid, the old ones should be not used anymore!

## ◆ productConsumed()

virtual void InAppPurchases::Listener::productConsumed | ( | const String & | ,
|  | bool | ,
|  | const String & | )
| virtual

Called whenever a product consumption finishes.

## ◆ productDownloadProgressUpdate()

virtual void InAppPurchases::Listener::productDownloadProgressUpdate | ( | Download & | ,
|  | float | ,
|  | RelativeTime | )
| virtual

iOS only: Called when a product download progress gets updated.

If the download was interrupted in the last application session, this callback may be called after the application starts.

If the download was in progress and the application was closed, the download may happily continue in the background by OS. If you open the app and the download is still in progress, you will receive this callback. If the download finishes in the background before you start the app again, you will receive productDownloadFinished callback instead. The download will only stop when it is explicitly cancelled or when it is finished.

## ◆ productDownloadPaused()

virtual void InAppPurchases::Listener::productDownloadPaused | ( | Download & |  | ) |
| virtual

iOS only: Called when a product download is paused.

This may also be called after the application starts, if the download was in a paused state and the application was closed before finishing the download.

Only after the download is finished successfully or cancelled you will stop receiving this callback on startup.

## ◆ productDownloadFinished()

virtual void InAppPurchases::Listener::productDownloadFinished | ( | Download & | ,
|  | const URL & | )
| virtual

iOS only: Called when a product download finishes (successfully or not).

Call Download::getStatus() to check if the downloaded finished successfully.

It is your responsibility to move the download content into your app directory and to clean up any files that are no longer needed.

After the download is finished, the download object is destroyed and should not be accessed anymore.

The documentation for this struct was generated from the following file:

- juce_InAppPurchases.h