Wrap a Native SDK Cleanly
Hide an iOS-only SDK behind expect/actual.
The Native SDK Problem
Some features only ship as an iOS-only SDK, like a payment or analytics kit. You still want one shared API your whole app can call. 🎁
Define the Contract First
Start in commonMain with a tiny interface describing what you need, in your own words, not the vendor SDK terms.
interface Analytics {
fun track(event: String)
}All lessons in this course
- Use Apple Frameworks from Kotlin
- Memory & ARC in Kotlin/Native
- cinterop with C Libraries
- Wrap a Native SDK Cleanly