Thread
#multiplatform
    t

    Theo

    2 years ago
    I'm looking at integrating a third party dependency that I'd like to be able to call from my Kotlin framework, it currently only exists as an SDK for iOS and Android, I'm wondering what are some approaches you've used to structure something like this, do you just build an expect / actual wrapper around the third party sdk?
    Kris Wong

    Kris Wong

    2 years ago
    yes
    s

    Sam

    2 years ago
    Another option is to declare interfaces in your library and have the calling app provide concrete implementations that wrap the platform library.
    Kweku

    Kweku

    2 years ago
    t

    Theo

    2 years ago
    thanks all, taking a look!
    kpgalligan

    kpgalligan

    2 years ago
    I would argue that the talk is more important than the library 🙂 https://vimeo.com/371460823
    Kweku

    Kweku

    2 years ago
    Question have you ever had come across a point where you couldn't wrap a library with expect actuals because of platform differences? In my case passing a lambda where one of the parameters was a interface on Android and a callback on Ios
    kpgalligan

    kpgalligan

    2 years ago
    There are always some differences. The firestore one had a weird thing where the same call was sync on ios and async on Android, so I had to kind of implement the async structure on iOS to give kotlin the same signature. In the firestore example, I use extensions to implement expect/actual because the underlying classes are always just a bit different.