Created
September 4, 2019 22:21
-
-
Save isaidamier/925af0a4fefecda4c2b97d814f4b387b 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
private fun instantiateAndConnectToPlayBillingService() { | |
playStoreBillingClient = BillingClient.newBuilder(application.applicationContext) | |
.enablePendingPurchases() // required or app will crash | |
.setListener(this).build() | |
connectToPlayBillingService() | |
} | |
private fun connectToPlayBillingService(): Boolean { | |
Log.d(LOG_TAG, "connectToPlayBillingService") | |
if (!playStoreBillingClient.isReady) { | |
playStoreBillingClient.startConnection(this) | |
return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment