AppPurchase

open class AppPurchase

Types

Link copied to clipboard
Enum representing the type of purchase for ad-disabling purposes.
Link copied to clipboard
Subscription replacement modes for upgrade/downgrade.
Link copied to clipboard
annotation class TYPE_IAP

Properties

Link copied to clipboard
open var discount: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var price: String
Link copied to clipboard
val PRODUCT_ID_TEST: String = "android.test.purchased"

Functions

Link copied to clipboard
open fun changeSubscription(activity: Activity, currentSubsId: String, newSubsId: String, replacementMode: AppPurchase.SubscriptionReplacementMode): String
Upgrades or downgrades from a specific subscription.
Link copied to clipboard
Link copied to clipboard
open fun consumePurchase()

open fun consumePurchase(productId: String)
Consumes a purchased product, allowing it to be purchased again.
Link copied to clipboard
open fun downgradeSubscription(activity: Activity, newSubsId: String): String
Downgrades a subscription to a lower tier.
Link copied to clipboard
Gets the type of purchase that is disabling ads.
Link copied to clipboard
Gets all active subscriptions with their states.
Link copied to clipboard
open fun getCurrency(productId: String, typeIAP: Int): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getIntroductorySubPrice(productId: String): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getPricePricingPhaseList(productId: String): List<ProductDetails.PricingPhase>
Link copied to clipboard
open fun getPriceSub(productId: String): String
Link copied to clipboard
open fun getPriceWithoutCurrency(productId: String, typeIAP: Int): Double
Link copied to clipboard
Gets the category of a purchased product.
Link copied to clipboard
open fun getPurchaseItem(productId: String): PurchaseItem
Gets the PurchaseItem configuration for a product ID.
Link copied to clipboard
open fun getSubscription(subscriptionId: String): PurchaseResult
Gets the subscription result for a specific product.
Link copied to clipboard
Gets the subscription state for a specific subscription.
Link copied to clipboard
open fun handlePurchase(purchase: Purchase)
Link copied to clipboard
Checks if user has a "Lifetime Premium" purchase specifically.
Link copied to clipboard
Checks if user has a lifetime premium purchase.
open fun hasLifetimePurchase(productId: String): Boolean
Checks if a specific product has been purchased and is currently owned.
Link copied to clipboard
Checks if user has a "Remove Ads" purchase specifically.
Link copied to clipboard
Checks if any subscription is cancelled but still has access.
Link copied to clipboard
open fun initBilling(application: Application, purchaseItemList: List<PurchaseItem>)
open fun initBilling(application: Application, listINAPId: List<String>, listSubsId: List<String>)
Link copied to clipboard
open fun isAvailable(): Boolean
Link copied to clipboard
open fun isProductOwned(productId: String): Boolean
Checks if a specific product is currently owned (purchased and not consumed).
Link copied to clipboard
open fun isPurchased(context: Context): Boolean
Link copied to clipboard
open fun isSubscribed(): Boolean
Checks if user has an active subscription (including cancelled but not expired).
open fun isSubscribed(subscriptionId: String): Boolean
Checks if user has a specific active subscription.
Link copied to clipboard
open fun purchase(activity: Activity)
open fun purchase(activity: Activity, productId: String): String
Link copied to clipboard
open fun queryProductDetails(productIds: List<String>, productType: String)
Link copied to clipboard
open fun refreshPurchases()
Refreshes and retrieves all current purchases from Google Play.
open fun refreshPurchases(productType: String)
Refreshes and retrieves current purchases for a specific product type.
Link copied to clipboard
open fun setBillingListener(billingListener: BillingListener)
open fun setBillingListener(billingListener: BillingListener, timeout: Int)
Link copied to clipboard
open fun setConsumePurchase(consumePurchase: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun setOldPrice(oldPrice: String)
Link copied to clipboard
open fun setPurchase(purchase: Boolean)
Link copied to clipboard
Sets a listener to receive purchase history events.
Link copied to clipboard
open fun setPurchaseListener(purchaseListener: PurchaseListener)
Link copied to clipboard
Link copied to clipboard
Checks if ads should be disabled based on any purchase type.
Link copied to clipboard
open fun subscribe(activity: Activity, subsId: String): String
Link copied to clipboard
Link copied to clipboard
open fun updateSubscription(activity: Activity, newSubsId: String, oldPurchaseToken: String, replacementMode: AppPurchase.SubscriptionReplacementMode): String
Upgrades or downgrades a subscription.
Link copied to clipboard
open fun upgradeSubscription(activity: Activity, newSubsId: String): String
Upgrades a subscription to a higher tier.
Link copied to clipboard
open fun verifyPurchased(isCallback: Boolean)
Link copied to clipboard
Checks if all subscriptions will auto-renew.