
Thin bridge delegating to native SDKs for offer presentation, user identification, attribute management, purchase lifecycle, passthrough events, and configurable claim UI with suspendable placement API.
Kotlin Multiplatform SDK for Encore — thin bridge delegating to native iOS and Android SDKs.
// build.gradle.kts
dependencies {
implementation("com.encorekit:encore-kmp:0.1.0")
}The iOS target is distributed via the KMP cocoapods plugin. In your KMP project's build.gradle.kts:
cocoapods {
pod("EncoreKit") { version = "1.4.36" }
}import com.encorekit.kmp.Encore
import com.encorekit.kmp.models.PresentationResult
// Identify user
Encore.identify(userId = "user_123")
// Show placement
val result = Encore.placement("cancel_flow").show()
when (result) {
is PresentationResult.Granted -> println("Offer accepted: ${result.offerId}")
is PresentationResult.NotGranted -> println("Declined: ${result.reason.value}")
}// Application.onCreate()
Encore.configure(context = this, apiKey = "pk_xxx")
// Activity.onCreate()
Encore.setActivity(this)
// Activity.onDestroy()
Encore.setActivity(null)// In common or iOS-specific code
Encore.configure(apiKey = "pk_xxx")The iOS target requires CocoaPods. The EncoreKMPBridge pod (included in iosHelper/) wraps the Swift-only EncoreKit APIs for Kotlin/Native cinterop.
applicationContext in configure() — required for the native SDKEncore.setActivity(activity) — required for presenting offer UIshared moduleiosHelper/EncoreKMPBridge.swift provides @objc wrappers for cinterop| Method | Description |
|---|---|
Encore.configure(apiKey, logLevel?) |
Initialize the SDK |
Encore.identify(userId, attributes?) |
Set current user |
Encore.setUserAttributes(attributes) |
Update user attributes |
Encore.reset() |
Clear user state |
Encore.placement(id?).show() |
Present an offer (suspend) |
Encore.placements.setClaimEnabled(bool) |
Enable/disable claim UI |
Encore.onPurchaseRequest { request -> } |
Handle purchase requests |
Encore.onPurchaseComplete { result, id -> } |
Handle purchase completions |
Encore.onPassthrough { placementId -> } |
Handle passthrough events |
make test # Run all tests
make build # Build all targets
make publish-local # Publish to ~/.m2 for local testing
make demo-android # Build Android demo APK
make demo-ios # Build iOS demo for simulator
make release # Interactive release flowcommonMain/ Public API (Encore object, models, expect classes)
androidMain/ Delegates to com.encorekit:encore (Maven Central)
iosMain/ Delegates to EncoreKMPBridge → EncoreKit (CocoaPods)
iosHelper/ Swift @objc bridge for cinterop
The SDK is a thin bridge (~600 LOC) with zero business logic — all behavior is delegated to the native SDKs.
Kotlin Multiplatform SDK for Encore — thin bridge delegating to native iOS and Android SDKs.
// build.gradle.kts
dependencies {
implementation("com.encorekit:encore-kmp:0.1.0")
}The iOS target is distributed via the KMP cocoapods plugin. In your KMP project's build.gradle.kts:
cocoapods {
pod("EncoreKit") { version = "1.4.36" }
}import com.encorekit.kmp.Encore
import com.encorekit.kmp.models.PresentationResult
// Identify user
Encore.identify(userId = "user_123")
// Show placement
val result = Encore.placement("cancel_flow").show()
when (result) {
is PresentationResult.Granted -> println("Offer accepted: ${result.offerId}")
is PresentationResult.NotGranted -> println("Declined: ${result.reason.value}")
}// Application.onCreate()
Encore.configure(context = this, apiKey = "pk_xxx")
// Activity.onCreate()
Encore.setActivity(this)
// Activity.onDestroy()
Encore.setActivity(null)// In common or iOS-specific code
Encore.configure(apiKey = "pk_xxx")The iOS target requires CocoaPods. The EncoreKMPBridge pod (included in iosHelper/) wraps the Swift-only EncoreKit APIs for Kotlin/Native cinterop.
applicationContext in configure() — required for the native SDKEncore.setActivity(activity) — required for presenting offer UIshared moduleiosHelper/EncoreKMPBridge.swift provides @objc wrappers for cinterop| Method | Description |
|---|---|
Encore.configure(apiKey, logLevel?) |
Initialize the SDK |
Encore.identify(userId, attributes?) |
Set current user |
Encore.setUserAttributes(attributes) |
Update user attributes |
Encore.reset() |
Clear user state |
Encore.placement(id?).show() |
Present an offer (suspend) |
Encore.placements.setClaimEnabled(bool) |
Enable/disable claim UI |
Encore.onPurchaseRequest { request -> } |
Handle purchase requests |
Encore.onPurchaseComplete { result, id -> } |
Handle purchase completions |
Encore.onPassthrough { placementId -> } |
Handle passthrough events |
make test # Run all tests
make build # Build all targets
make publish-local # Publish to ~/.m2 for local testing
make demo-android # Build Android demo APK
make demo-ios # Build iOS demo for simulator
make release # Interactive release flowcommonMain/ Public API (Encore object, models, expect classes)
androidMain/ Delegates to com.encorekit:encore (Maven Central)
iosMain/ Delegates to EncoreKMPBridge → EncoreKit (CocoaPods)
iosHelper/ Swift @objc bridge for cinterop
The SDK is a thin bridge (~600 LOC) with zero business logic — all behavior is delegated to the native SDKs.