Loading...
Searching...
No Matches
juce::InAppPurchases::Listener Struct Reference

## Detailed Description

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

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

- juce_product_unlocking/in_app_purchases/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).

## Constructors and Destructors

## ~Listener()

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

inline virtual

## Member Functions

## productsInfoReturned()

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

inline virtual

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

## productPurchaseFinished()

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

inline 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 juce::InAppPurchases::Listener::purchasesListRestored | ( | const Array< PurchaseInfo > & | ,
|  | bool | ,
|  | const String & | )

inline 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 juce::InAppPurchases::Listener::productConsumed | ( | const String & | ,
|  | bool | ,
|  | const String & | )

inline virtual

Called whenever a product consumption finishes.

## productDownloadProgressUpdate()

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

inline 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 juce::InAppPurchases::Listener::productDownloadPaused | ( | Download & |  | ) |

inline 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 juce::InAppPurchases::Listener::productDownloadFinished | ( | Download & | ,
|  | const URL & | )

inline 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.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited