Skip to content

Latest commit

 

History

History

README.md

OpenIAP Android

OpenIAP Google Logo

Android implementation of the OpenIAP specification using Google Play Billing.


Maven Central API Google Release CI License

Modern Android Kotlin library for in-app purchases using Google Play Billing Library v8.

Documentation

Visit openiap.dev for complete documentation, API reference, guides, and examples.

Features

  • Google Play Billing v8
  • Kotlin Coroutines
  • Type-safe API with sealed classes
  • Real-time purchase events
  • Thread-safe operations
  • Comprehensive error handling

Requirements

  • Minimum SDK: 21 (Android 5.0)
  • Compile SDK: 34+
  • Google Play Billing: v8.0.0
  • Kotlin: 1.9.20+

Installation

Add to your module's build.gradle.kts:

dependencies {
    implementation("io.github.hyochan.openiap:openiap-google:$version")
}

Check openiap-versions.json for the current version.

Quick Start

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.

Sample App

Run the included sample app:

cd packages/google
./gradlew :Example:installDebug

License

MIT License - see LICENSE for details.

Support