KMPRevenueCat
Unofficial RevenueCat wrapper library for Kotlin Multiplatform. It provides a unified API for managing subscription and in-app purchases across both iOS and Android platforms.
Install / Use
/learn @mirzemehdi/KMPRevenueCatREADME
KMPRevenueCat - Kotlin Multiplatform RevenueCat Library
⚠️ Repository Archived
This repository is archived and no longer maintained.
This project is officially supported by RevenueCat. Please refer to the official repository for the latest updates, issues, and contributions.
- No new issues or pull requests will be accepted here.
- For any questions or contributions, please use the official repository.
KMPRevenueCat is an unofficial Kotlin Multiplatform library designed as a wrapper for RevenueCat. It provides a unified API for managing subscription and in-app purchases across both iOS and Android platforms. You can see how this library is used in FindTravelNow production Compose + KMP project. For the documentation, please refer to the official RevenueCat Documentation, Kotlin section. The library is designed in the same way as it is shown in the official documentation.
Related Blog Post (if you want to integrate it yourself without this library): https://medium.com/@mirzemehdi/integrating-revenuecat-into-kotlin-multiplatform-465ffa47a97b
Installation
Minimum Requirements
-
Android:
minSdkVersion 24 -
iOS:
minDeploymentTarget 15.0 -
RevenueCat Android version:
7.11.0 -
RevenueCat iOS version:
4.43.0
Gradle Setup
KMPRevenueCat is available on Maven Central. In your root project build.gradle.kts file (or settings.gradle file) add mavenCentral() to repositories.
You will also need to include RevenueCat library to your ios app from XCode using Swift Package Manager or Cocoapods.
repositories {
mavenCentral()
}
Then in your shared module add desired dependencies in commonMain. Latest version: .
sourceSets {
commonMain.dependencies {
implementation("io.github.mirzemehdi:kmprevenuecat-purchases:<version>") //RevenueCat Purchases
implementation("io.github.mirzemehdi:kmprevenuecat-purchases-ui:<version>") //RevenueCat Purchases UI
}
}
Available Functions
Purchases
var logLevel: LogLevel
fun configure(apiKey: String, appUserId: String? = null)
fun login(appUserId: String, onResult: (Result<LogInResult>) -> Unit)
fun logOut(onResult: (Result<CustomerInfo>) -> Unit)
fun getCustomerInfo(fetchPolicy: CacheFetchPolicy = CacheFetchPolicy.default(),onResult: (Result<CustomerInfo>) -> Unit)
fun setAttributes(attributes: Map<String,String?>)
fun setFirebaseAppInstanceID(firebaseAppInstanceID: String)
fun collectDeviceIdentifiers()
fun enableAdServicesAttributionTokenCollection()
fun syncPurchases(onResult: (Result<CustomerInfo>) -> Unit)
Purchases-UI
//This Composable can be used in Compose Multiplatform
@Composable
fun Paywall(shouldDisplayDismissButton: Boolean = true,onDismiss: () -> Unit,listener: PaywallListener?)
Related Skills
node-connect
354.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
