Skip to content

Commit 8a5e740

Browse files
authored
Merge pull request #32 from TelemetryDeck/fix-build-for-android-5
Use OkHttp engine to ensure compatibility with Android 5 and 6
2 parents 10f3a03 + 9f321c4 commit 8a5e740

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies {
4747
implementation 'com.google.android.material:material:1.4.0'
4848
// HTTP Client
4949
implementation "io.ktor:ktor-client-core:$ktor_version"
50-
implementation "io.ktor:ktor-client-cio:$ktor_version"
50+
implementation "io.ktor:ktor-client-okhttp:$ktor_version"
5151
// HTTP Serialization
5252
implementation "io.ktor:ktor-client-serialization:$ktor_version"
5353
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"

lib/src/main/java/com/telemetrydeck/sdk/TelemetryClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.telemetrydeck.sdk
22

33
import io.ktor.client.*
4-
import io.ktor.client.engine.cio.*
4+
import io.ktor.client.engine.okhttp.*
55
import io.ktor.client.plugins.DefaultRequest
66
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
77
import io.ktor.client.plugins.logging.DEFAULT
@@ -18,7 +18,7 @@ import java.util.*
1818
* The HTTP client to communicate with TelemetryDeck's API
1919
*/
2020
internal class TelemetryClient(private val telemetryAppID: UUID, private val apiBaseURL: URL, private val showDebugLogs: Boolean, private val debugLogger: DebugLogger?) {
21-
private val client: HttpClient = HttpClient(CIO) {
21+
private val client: HttpClient = HttpClient(OkHttp) {
2222
install(ContentNegotiation) {
2323
json()
2424
}

0 commit comments

Comments
 (0)