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

Tom Wayne

07/09/2021, 5:40 AM
Hello everybody, Iam developing KMM used by iOS and Android client. I need to use websockets there.Do you have experience with any library which works both for iOS and Android part? Thanks
b

Big Chungus

07/09/2021, 7:53 AM
Ktor?
t

Tom Wayne

07/09/2021, 7:57 AM
According to the KTOR doc: Ktor provides Websocket client support for the following engines: CIO, OkHttp, Js. None of them is compatible with iOS so it looks like I cant use it for WS on iOS.
👍 1
b

Big Chungus

07/09/2021, 8:43 AM
CIO is available on ios. Just checked here
h

hfhbd

07/09/2021, 11:42 AM
@Big Chungus Wait, you use the CIO engine on iOS too?
b

Big Chungus

07/09/2021, 11:42 AM
I don't do any IOS development, I'm just saying that CIO client engine library is available on IOS
Search by
ktor cio
h

hfhbd

07/09/2021, 12:30 PM
I tested it with CIO, but
TLS sessions are not supported on Native platform.
Fortunately, you can use
ktor-client-ios
, based on iOS
URLSession
j

Jolas

07/23/2021, 8:35 AM
WebSockets aren't supported in ktor yet. But we have our own implementation. https://github.com/ln-12/kmm-websocket This might be helpful @Martin Rajniak
h

Hossein Amini

08/08/2021, 12:03 PM
@Jolas is it compatible with iOS < 13?
a

alex009

08/08/2021, 12:14 PM
also you can use custom ktorEngine wrapper as i do here - https://github.com/Alex009/ktor-client-ios-websockets later this engine will be available in moko-network - https://github.com/icerockdev/moko-network/issues/149
h

Hossein Amini

08/08/2021, 12:37 PM
@alex009 is it compatible with iOS < 13?
368 Views