fix(android): switch Ktor CIO engine to OkHttp for stable background WebSocket

CIO uses Java NIO selectors which Android's power management freezes
when the app is backgrounded, dropping the WebSocket connection. OkHttp
is Android-native and maintains connections through the OS network stack.
This commit is contained in:
Somasundaram Mahesh
2026-02-18 18:49:14 +05:30
parent 0b36d92fef
commit 45766621f2
3 changed files with 4 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ dependencies {
implementation(libs.androidx.compose.material3)
// Ktor WebSocket
implementation(libs.ktor.client.cio)
implementation(libs.ktor.client.okhttp)
implementation(libs.ktor.client.websockets)
implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.serialization.kotlinx.json)