https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

Mikołaj Karwowski

01/30/2020, 3:26 PM
I'm willing to create a HttpClient(CIO), but CIO is not found/accessible Although the package io.ktor.http.cio and CIOHeaders is well visible 😕
k

Kris Wong

01/30/2020, 3:31 PM
we had an issue with CIO on Android. had to use one of the Android engines.
i don't recall what it was off the top of my head, but it had been reported and was still open
👍 1
in terms of your specific problem, do you have the proper dependencies for common as well as each target?
m

Mikołaj Karwowski

01/30/2020, 3:40 PM
I have absolutely no clue if I do. I'm just starting with it 😕 implementation("io.ktorktor client cio$ktor_version") I have this dependency set for all three of them - commonMain, androidMain and iosMain From what I got it should be requiring no dependencies and I didn't find specific android/iOS versions of library (https://ktor.io/clients/http-client/engines.html)
Did You successfully use Android engine for WebSockets? I can't find it now, but I ve seen on Kotlin or Ktor website, that only CIO is working with websocket
k

Kris Wong

01/30/2020, 3:43 PM
never used WebSockets
however, the artifact name is different per platform
m

Mikołaj Karwowski

01/30/2020, 3:44 PM
Got it: https://ktor.io/clients/websockets.html#artifact-15 (doesn't list Android/iOs as valid engines) https://amryousef.me/android-ktor (Explicit note it's only for CIO)
m

Mikołaj Karwowski

01/30/2020, 3:45 PM
ah, ok, sure. How can one find artifact names tho? I don't think I ve seen ios/android versions of CIO on maven neither
there is only one engine for iOS
m

Mikołaj Karwowski

01/30/2020, 3:46 PM
Yes, and it's not CIO 😛
k

Kris Wong

01/30/2020, 3:47 PM
so your take away today, CIO is broken on android and not available on iOS 😛
m

Mikołaj Karwowski

01/30/2020, 3:48 PM
Thus websockets are impossible to use in multiplatform... That's what I thought 😕 Shame
k

Kris Wong

01/30/2020, 3:48 PM
Ktor provides a WebSocket client for the following engines: CIO, OkHttp, Js
m

Mikołaj Karwowski

01/30/2020, 3:48 PM
But thanks for Your replies! Appreciate it! 🎉
🍻 1
k

Kris Wong

01/30/2020, 3:48 PM
so you can use OkHttp on Android
m

Mikołaj Karwowski

01/30/2020, 3:49 PM
OkHttp - Android, sure but what about iOS?
k

Kris Wong

01/30/2020, 3:49 PM
SOL
m

Mikołaj Karwowski

01/30/2020, 3:49 PM
there's just no way yet to implement it, aye?
k

Kris Wong

01/30/2020, 3:49 PM
not that I can see
m

Mikołaj Karwowski

01/30/2020, 3:50 PM
Okay, so we got that settled : ) Great, thanks! 👏
25 Views