AutomaticPurchaseController

class AutomaticPurchaseController(var context: Context, val scope: IOScope, val entitlementsInfo: Entitlements, val getBilling: (Context, PurchasesUpdatedListener) -> BillingClient = { ctx, listener -> try { BillingClient .newBuilder(ctx) .setListener(listener) .enablePendingPurchases( PendingPurchasesParams.newBuilder().enableOneTimeProducts().build(), ).build() } catch (e: Throwable) { Logger.debug( logLevel = LogLevel.error, scope = LogScope.nativePurchaseController, message = BILLING_INSANTIATION_ERROR, info = mapOf("error_message" to (e.message ?: "Unknown message")), error = e, ) throw e } }) : PurchaseController, PurchasesUpdatedListener(source)

Constructors

Link copied to clipboard
constructor(context: Context, scope: IOScope, entitlementsInfo: Entitlements, getBilling: (Context, PurchasesUpdatedListener) -> BillingClient = { ctx, listener -> try { BillingClient .newBuilder(ctx) .setListener(listener) .enablePendingPurchases( PendingPurchasesParams.newBuilder().enableOneTimeProducts().build(), ).build() } catch (e: Throwable) { Logger.debug( logLevel = LogLevel.error, scope = LogScope.nativePurchaseController, message = BILLING_INSANTIATION_ERROR, info = mapOf("error_message" to (e.message ?: "Unknown message")), error = e, ) throw e } })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val getBilling: (Context, PurchasesUpdatedListener) -> BillingClient
Link copied to clipboard

Functions

Link copied to clipboard
open override fun onPurchasesUpdated(billingResult: BillingResult, purchases: MutableList<Purchase>?)
Link copied to clipboard
open suspend override fun purchase(activity: Activity, productDetails: ProductDetails, basePlanId: String?, offerId: String?): PurchaseResult

Called when the user initiates purchasing of a product.

Link copied to clipboard
open suspend override fun restorePurchases(): RestorationResult

Called when the user initiates a restore.