{"repo":"hypersoftdev/inappbilling","free":true,"listed":false,"github":"https://github.com/hypersoftdev/inappbilling","clone":"git clone https://github.com/hypersoftdev/inappbilling.git","description":"inappbilling is a Google Play Billing library that demonstrates how to implement in-app purchases and subscriptions in your Android application","language":"Kotlin","stars":29,"topics":["google-inapp","inapp","inapp-billing","inapppurchase","inappupdate","billing","billing-library"],"license":null,"category":"auth-billing-email","readme_excerpt":"inappbilling inappbilling is a Google Play Billing library (Play Billing Library 9.1.0) that demonstrates how to implement in-app purchases and subscriptions in your Android application using Kotlin coroutines and Flow . [!IMPORTANT] Version 4.0.0 is a breaking rewrite. The listener-based API ( BillingConnectionListener , BillingPurchaseListener , etc.) has been replaced with suspend fun s and Flow s, and moved to Play Billing Library 9.1.0. See Migrating from 3.x below. Gradle Integration Step A: Add Maven Repository In your project-level build.gradle or settings.gradle file, add the JitPack repository: Step B: Add Dependencies In your app-level build.gradle file, add the library dependency. Use the latest version: --- Technical Implementation BillingManager is meant to be created once , as a singleton scoped to your Application — not per- Activity / ViewModel . Play's purchase callback can fire at any time, including after the screen that started a purchase is gone, so BillingManager owns its own internal coroutine scope rather than accepting one from the caller. Connect once, early, and let every screen just observe state from then on. Step 1: Create the singleton and connect (in your Application ) On a successful connect() , productsState and purchasesState (below) refresh automatically in the background — there's no separate \"now fetch products/purchases\" step to remember. Reading connectionState connect() 's return value is a one-shot snapshot — useful right after you c","default_branch":null,"files":null,"tree":[],"storefront":"/r/hypersoftdev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hypersoftdev/inappbilling/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}