JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::InAppPurchases::Listener Struct Reference

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

Detailed Description

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

Constructor & Destructor Documentation

◆ ~Listener()

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

Member Function Documentation

◆ productConsumed()

virtual void juce::InAppPurchases::Listener::productConsumed ( const String ,
bool  ,
const String  
)
inlinevirtual

Called whenever a product consumption finishes.

◆ productDownloadFinished()

virtual void juce::InAppPurchases::Listener::productDownloadFinished ( Download ,
const URL  
)
inlinevirtual

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.

◆ productDownloadPaused()

virtual void juce::InAppPurchases::Listener::productDownloadPaused ( Download )
inlinevirtual

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.

◆ productDownloadProgressUpdate()

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

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.

◆ productPurchaseFinished()

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

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!

◆ productsInfoReturned()

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

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

◆ purchasesListRestored()

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

Called when a list of all purchases is restored.

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

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!


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