How we built the RevenueCat SDK for Kotlin Multiplatform
Blog post from RevenueCat
The purchases-kmp GitHub repository has reached its stable v1 release, evolving from its origins as an unofficial RevenueCat library called KobanKat. Built using Kotlin Multiplatform (KMP), the library allows developers to write shared code for both Android and iOS platforms without the need for separate platform-specific code for in-app purchases and subscriptions. Google announced support for KMP at Google I/O 2024, contributing to the rapid growth of its ecosystem. The RevenueCat SDK for Kotlin Multiplatform simplifies subscription code implementation compared to Apple’s StoreKit and Google’s Play Billing Library. The SDK is developed with a top-down architecture to leverage existing platform SDKs, a choice influenced by the flexibility of KMP and the need to avoid rewriting extensive platform-specific code. The SDK includes the purchases-kmp-core library for core functionality and purchases-kmp-ui for Paywalls, along with optional modules for date-time handling and error management, allowing seamless integration and familiar usage for existing RevenueCat users across platforms.