WebSocket Library for Kotlin Native?

Hey! Just an update, the CIO engine for Ktor is currently not available for Native unfortunately. I installed the dependency into my project but could not import the library into any of my classes targeting the iOS platform. I could however do this for JS and Java and could utilise the library. I have seen comments that Ktor are working on creating a WebSocket client for iOS but it may be months away.

Thanks for your suggestion above! That’s definitely a viable option for me actually, but I’ll need to pass it by my team since it’s production code. I’m going to add this to my ‘list’ of interim/workaround/slightly hacky solutions. (haha)

I’ve also joined the Kotlinlang slack channel, so I’ll post some questions there to see if they have any ideas on this one. If not, my other and last interim/workaround/hacky option is to pull all my code for my Multiplatform project into Xcode and create a Kotlin/Native project from it. Which means maintaining two exact code bases, one for Native/iOS and the other for JavaScript and Java (I hate saying that) until Ktor hopefully comes to the rescue.

2 Likes