Skip to content

Instantly share code, notes, and snippets.

@LethalMaus
Created March 11, 2024 21:42
Show Gist options
  • Select an option

  • Save LethalMaus/9d2e4d02022cdfa43c40f8f1b52c9947 to your computer and use it in GitHub Desktop.

Select an option

Save LethalMaus/9d2e4d02022cdfa43c40f8f1b52c9947 to your computer and use it in GitHub Desktop.
monetization.kt
override fun onPurchasesUpdated(billingResult: BillingResult, purchases: List<Purchase>?) {
if (billingResult.responseCode == BillingResponseCode.OK && purchases != null) {
for (purchase in purchases) {
handlePurchase(purchase)
}
} else if (billingResult.responseCode == BillingResponseCode.USER_CANCELED) {
// Handle an error caused by a user cancelling the purchase flow.
} else {
// Handle any other error codes.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment