The K/N 0.8 blog post says: `Other important JetBr...
# kotlin-native
s
The K/N 0.8 blog post says:
Other important JetBrains-provided libraries, like kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client are getting experimental Kotlin/Native support, which means it is possible to write an iOS app and Android application sharing the same REST API-related logic.
I don't see kotlin/native access for these libraries. Do I need to access special branches? My team actually wants to start using the kotlin/native counterparts for all of these.
👍 5
t
Http client is a separate library
s
Can we get links / instructions to use all of these counterparts?
7
t
k
Damn that's sweet. I've written something similar twice now lol.
t
The main issue with http client that it is only async - you can't make blocking call
And it is expect/actual inside so yes, you can easily create the same in ~100 lines of code for both platforms
b
thanks @thevery, i am looking something similar
o
s
Anything or kotlinx.coroutines?
l
I am trying to use Ktor client (to code REST api client once and use it on android and on iOS ). I successfully added dependency via gradle: "compile group: 'io.ktor', name: 'ktor-client', version: '0.9.3' " but references to HttpClient are still unresolved. Any idea how to use ktor in kotlin native?
b
i think ktor client does not support kotlin native, you can use
e5l/http-client-common
. https://github.com/e5l/http-client-common
here, I am making list of awesome-kotlin-native. Feel free to update if find something. https://github.com/bipinvaylu/awesome-kotlin-native
l
I am a little confused since kotlin native 0.8 release notes mention ktor native support?
b
okay
>>Other important JetBrains-provided libraries, like kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client are getting experimental Kotlin/Native support, which means it is possible to write an iOS app and Android application sharing the same REST API-related logic.
you are right, they are providing experimental support
o
it’s experimental support in feature branch, not official one, just for brave souls to test
l
Is this branch currently on github? Can i use it in my project?
s
How do I access the kotlinx.coroutines native code?