Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. private fun instantiateAndConnectToPlayBillingService() {
  2. playStoreBillingClient = BillingClient.newBuilder(application.applicationContext)
  3. .enablePendingPurchases() // required or app will crash
  4. .setListener(this).build()
  5. connectToPlayBillingService()
  6. }
  7.  
  8. private fun connectToPlayBillingService(): Boolean {
  9. Log.d(LOG_TAG, "connectToPlayBillingService")
  10. if (!playStoreBillingClient.isReady) {
  11. playStoreBillingClient.startConnection(this)
  12. return true
  13. }
  14. return false
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement