Hi, i can not find in google anything about how to combine platform-specific libraries in KMP. its the same scenario like https://github.com/touchlab/CrashKiOS - this library combines Crashlytics IOS lib for IOS target and Crashlytics AN for Android.
k
kpgalligan
05/14/2024, 12:03 AM
I don't think you'll find a ton out there, and it depends on what you want to figure out. Mechanical setup? Common API design?
I gave a talk called "Bridging the API Gap", or something similar to that. The title on the page and video title are wrong (I gave that talk a few weeks later at Droidcon Berlin), but the content is correct: https://www.droidcon.com/2022/06/28/sdk-design-and-publishing-for-kotlin-multiplatform-mobile/
👍 1
kpgalligan
05/14/2024, 12:04 AM
(I wrote CrashKiOS, BTW)
👏 2
kpgalligan
05/14/2024, 12:06 AM
For API design, some considerations. Is this just for internal use or as a published API? If internal, it's easier to figure out the subset you're really interested in, assuming it's not the whole API. Also, you can generally get by with "functional" rather than "elegant". If this is intended to be a public thing, there's maybe more work required for API design.
CrashKiOS makes no effort to cover the whole API of each. Features have been added as they're requested.
kpgalligan
05/14/2024, 12:08 AM
For mechanical, Android is usually much easier, as you're directly participating in the Gradle/Maven dependency system. iOS can be tough. In the case of CrashKiOS, Crashlytics and Bugsnag will be added to the iOS app by the iOS team, so you don't want to specify a hard dependency in the Kotlin code. However, when you're building Kotlin, the build will want to link to the binaries. Still need to find a good general solution.