Hi Guys. I am just trying out Multiplatform. I wan...
# announcements
j
Hi Guys. I am just trying out Multiplatform. I wanted to write a multiplatform library that connects to a P*ayment API*. The library should work on all platforms (Android, iOS, Windows, Javascript e.t.c). Any ideas on how I should go about this?
👍 3
c
take a look at
korio
there you can find source how to write http client, that you can use for API calls https://github.com/korlibs/korio
n
Multiplatform is still a dark art I feel. I just dove in and here's my 10,000 ft opinion. IntelliJ has good docs with some good best practices. Sadly even they don't adhere to them if you look at their own multiplatform stuff like serialization and IO. The korio work above looked pretty good - but also a bit off the "official" pattern. Things are changing fast I guess and people aren't able to keep up. I tried to stick as close to the best practices as I could here if interested. https://github.com/nwillc/ksvg
j
Thanks guys. I looked at korio and it is complex. Should I create my own Http client or use a library like ktor? Should I use coroutines in the library? Then should I use a certain architecture (I come from Android do I am used to MVVM).
c
in my opinion: take http client class from korio (not all complex library) and use kotlinx-serialization, in that case you will have light weight multiplatform implementation