Skip to content

Commit

Permalink
Merge pull request #32 from TelemetryDeck/fix-build-for-android-5
Browse files Browse the repository at this point in the history
Use OkHttp engine to ensure compatibility with Android 5 and 6
  • Loading branch information
kkostov authored Jul 16, 2024
2 parents 10f3a03 + 9f321c4 commit 8a5e740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
implementation 'com.google.android.material:material:1.4.0'
// HTTP Client
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "io.ktor:ktor-client-cio:$ktor_version"
implementation "io.ktor:ktor-client-okhttp:$ktor_version"
// HTTP Serialization
implementation "io.ktor:ktor-client-serialization:$ktor_version"
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
Expand Down
4 changes: 2 additions & 2 deletions lib/src/main/java/com/telemetrydeck/sdk/TelemetryClient.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.telemetrydeck.sdk

import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.engine.okhttp.*
import io.ktor.client.plugins.DefaultRequest
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.client.plugins.logging.DEFAULT
Expand All @@ -18,7 +18,7 @@ import java.util.*
* The HTTP client to communicate with TelemetryDeck's API
*/
internal class TelemetryClient(private val telemetryAppID: UUID, private val apiBaseURL: URL, private val showDebugLogs: Boolean, private val debugLogger: DebugLogger?) {
private val client: HttpClient = HttpClient(CIO) {
private val client: HttpClient = HttpClient(OkHttp) {
install(ContentNegotiation) {
json()
}
Expand Down

0 comments on commit 8a5e740

Please sign in to comment.