Listener

interface Listener

Listener for events relating to app premium billing.

Functions

Link copied to clipboard
abstract fun onCheckPremium(state: Premium.State)

Informs if the user has premium rights to the app. It's invoked after calling checkPremium function of Premium.Controller. The reported state is the one obtained directly from the billing client, and in the event that it is not possible to obtain that value, the value of the preferences is reported.

Link copied to clipboard
abstract fun onPurchaseResult(result: Premium.State)

Reports the result of the purchase, and when the premium status changes.

Link copied to clipboard
abstract fun onSkuDetails(skuDetails: List<SkuDetails>?)

Informs the details of the products (title, price, description, etc.). It's invoked after requesting products details with Premium.Controller.getSkuDetails().

Link copied to clipboard
abstract fun onStartPurchaseError(code: Int)

It's invoked when an error occurs and it is not possible to start the purchase flow (generally it is a connection error in the billing client).