Last active
September 4, 2019 22:31
-
-
Save isaidamier/5919788ab246a5f083e33bc13e1ca777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBillingSetupFinished(billingResult: BillingResult) { | |
when (billingResult.responseCode) { | |
BillingClient.BillingResponseCode.OK -> { | |
Log.d(LOG_TAG, "onBillingSetupFinished successfully") | |
... | |
queryPurchases() | |
} | |
... | |
} | |
} | |
fun queryPurchases() { | |
Log.d(LOG_TAG, "queryPurchasesAsync called") | |
val purchasesResult = HashSet<Purchase>() | |
var result = playStoreBillingClient.queryPurchases(BillingClient.SkuType.INAPP) | |
result?.purchasesList?.let { purchasesResult.addAll(it) } | |
processPurchases(purchasesResult) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment