A reusable, clean, and modern implementation of Google Play Billing using Kotlin, Dagger Hilt, and coroutines.
Supports one-time purchases (INAPP) and subscriptions (SUBS) with proper handling for purchase states, errors, and acknowledgment.
- β Two-way billing package -> DI & Object
- β Supports in-app purchases and subscriptions
- β Handles acknowledgment, pending, and already purchased states
- β
Uses
BillingClientwith proper lifecycle handling - β Coroutine-powered product querying
- β
Plug-and-play State Flows (
products, billingEvents) - β Built with Dagger Hilt for dependency injection
- β Support MVVM Architecture (viewModel & repository)
- β Support billing through Object
- β Billing Library
- β Dependency Injection (Dagger/Hilt)
- β NO Dependency Injection (Dagger/Hilt) with Util as an Object
- β Copy Paste package and use
Initialize viewModel to start billing connection automatically or inject billing repositoy in your Application class to start billing connection automatically and fetch, restore products automatically.
Initialize Billing util with initBillingClient() fuction in your application class to start billing connection, fetch and restore product purchase states.