Android implementation of the OpenIAP specification using Google Play Billing.
Modern Android Kotlin library for in-app purchases using Google Play Billing Library v9.1.
Visit openiap.dev for complete documentation, API reference, guides, and examples.
- Google Play Billing v9.1
- Kotlin Coroutines
- Type-safe API with sealed classes
- Real-time purchase events
- Thread-safe operations
- Comprehensive error handling
- Minimum SDK: 23 (Android 6.0)
- Compile SDK: 36
- Google Play Billing: v9.1.0
- Kotlin compiler (consumer): 2.1.20+
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.
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:installDebugThank you to Meta and Amazon Developer for supporting OpenIAP. View sponsorship options.
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.
Become a sponsor | Become a backer
Supported the project before the OpenIAP sponsor program.
MIT License - see LICENSE for details.