I am looking for a WebSocket library that I can use in a Kotlin Multiplatform project for my iOS/Native implementation. This project is currently in IntelliJ and I am using Gradle (Kotlin DSL) to manage dependencies.
To give some more context I have the following for my project:
- Kotlin Common code for all my common functionality for the project
Firstly, the reason for the platform specific implementations for WebSockets is because I have not found a common library that supports WebSockets for all platforms that can be written in the common Kotlin code. While Ktor comes close, from what I see in their documentation their WebSocket client does not support iOS (their Http client supports all platforms)
Secondly, there are a bundle of WebSocket Swift/C libraries (Starscream, Socket.io, SocketRocket etc) that can be used in Kotlin Native via CocoaPods in Xcode but since I am writing a Multiplatform project in IntelliJ with Gradle, there is no way to include these libraries in my project dependencies. I’ve also tried using the Gradle Source Dependency option, but IntelliJ cannot build the Swift/C source from Git so this is also not an option.
I am open to any suggestions at this point as I am really trying to avoid the route of writing a whole Swift client library for my project, as the reason we started with Kotlin Multiplatform was to avoid supporting the multitude of client libraries we have to write and support for our clients.
If anyone has any recommendations that would be really helpful.