Skip to content

Instantly share code, notes, and snippets.

@isaidamier
Last active September 4, 2019 22:31
Show Gist options
  • Save isaidamier/5919788ab246a5f083e33bc13e1ca777 to your computer and use it in GitHub Desktop.
Save isaidamier/5919788ab246a5f083e33bc13e1ca777 to your computer and use it in GitHub Desktop.
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