File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ data class ReleaseInfoDTO(
1616data class Platforms (
1717 @SerialName(" android" )
1818 val android : PlatformDetails ,
19+ @SerialName(" ios" )
20+ val ios : PlatformDetails ? ,
1921)
2022
2123/* *
Original file line number Diff line number Diff line change 11package to.bitkit.services
22
33import io.ktor.client.HttpClient
4- import io.ktor.client.call.body
54import io.ktor.client.request.get
65import io.ktor.client.statement.HttpResponse
6+ import io.ktor.client.statement.bodyAsText
77import io.ktor.http.isSuccess
8+ import kotlinx.serialization.json.Json
89import to.bitkit.data.dto.ReleaseInfoDTO
910import to.bitkit.env.Env
1011import to.bitkit.utils.AppError
@@ -20,7 +21,9 @@ class AppUpdaterService @Inject constructor(
2021 val response: HttpResponse = client.get(Env .RELEASE_URL )
2122 return when (response.status.isSuccess()) {
2223 true -> {
23- val responseBody = runCatching { response.body<ReleaseInfoDTO >() }.getOrElse {
24+ val responseBody = runCatching {
25+ Json .decodeFromString<ReleaseInfoDTO >(response.bodyAsText())
26+ }.getOrElse {
2427 throw AppUpdaterError .InvalidResponse (it.message.orEmpty())
2528 }
2629 responseBody
You can’t perform that action at this time.
0 commit comments