Android implementation of the OpenIAP specification using Google Play Billing.
Modern Android Kotlin library for in-app purchases using Google Play Billing Library v8.
Visit openiap.dev for complete documentation, API reference, guides, and examples.
- Google Play Billing v8
- Kotlin Coroutines
- Type-safe API with sealed classes
- Real-time purchase events
- Thread-safe operations
- Comprehensive error handling
- Minimum SDK: 21 (Android 5.0)
- Compile SDK: 34+
- Google Play Billing: v8.0.0
- Kotlin: 1.9.20+
Add to your module's build.gradle.kts:
dependencies {
implementation("io.github.hyochan.openiap:openiap-google:$version")
}Check
openiap-versions.jsonfor the current version.
import dev.hyo.openiap.store.OpenIapStore
class MainActivity : AppCompatActivity() {
private lateinit var iapStore: OpenIapStore
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
iapStore = OpenIapStore(this)
lifecycleScope.launch {
// Initialize connection
iapStore.initConnection()
// Fetch products
val products = iapStore.fetchProducts(
ProductRequest(skus = listOf("premium_upgrade"))
)
}
}
}For detailed usage, see the documentation.
Run the included sample app:
cd packages/google
./gradlew :Example:installDebugMIT License - see LICENSE for details.