Skip to content

Instantly share code, notes, and snippets.

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

  • Save LethalMaus/6e138a73d1f9283035b4651c89817a6d to your computer and use it in GitHub Desktop.

Select an option

Save LethalMaus/6e138a73d1f9283035b4651c89817a6d to your computer and use it in GitHub Desktop.
monetization.kt
billingClient.startConnection(object : BillingClientStateListener {
override fun onBillingSetupFinished(billingResult: BillingResult) {
if (billingResult.responseCode == BillingResponseCode.OK) {
// The BillingClient is ready. You can query purchases here.
}
}
override fun onBillingServiceDisconnected() {
// Try to restart the connection on the next request to
// Google Play by calling the startConnection() method.
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment