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 v9.1.

Documentation

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

Features

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

Requirements

  • Minimum SDK: 23 (Android 6.0)
  • Compile SDK: 36
  • Google Play Billing: v9.1.0
  • Kotlin compiler (consumer): 2.1.20+

Installation

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

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

Use the latest version from Maven Central or the badge above.

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

Sponsors

Meta        Amazon Developer

Thank you to Meta and Amazon Developer for supporting OpenIAP. View sponsorship options.

OpenCollective

We also recognize sponsors and backers through OpenCollective. The original react-native-iap collective now supports the broader OpenIAP ecosystem and is managed separately from the main sponsor program.

Sponsors: OpenCollective sponsors

Backers: OpenCollective backers

Become a sponsor | Become a backer

Past supporters

Supported the project before the OpenIAP sponsor program.

Nami      Courier

License

MIT License - see LICENSE for details.

Support