Skip to content

Commit

Permalink
[distribution] Send version{Code,Name} when checking for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chromy committed Dec 19, 2024
1 parent 6fad6cf commit a448f36
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ private suspend fun doCheckForUpdate(context: Context, state: State): UpdateStat
return UpdateStatus.Error("No API key available")
}

val info = context.packageManager.getPackageInfo(applicationId, 0)
val version = info.versionName
val build = info.versionCode

val url = HttpUrl.Builder().apply {
scheme("https")
host("api.emergetools.com")
Expand All @@ -214,6 +218,8 @@ private suspend fun doCheckForUpdate(context: Context, state: State): UpdateStat
addQueryParameter("apiKey", apiKey)
addQueryParameter("tag", state.tag)
addQueryParameter("appId", applicationId)
addQueryParameter("version", version)
addQueryParameter("build", build.toString())
addQueryParameter("platform", "android")
}.build()

Expand Down

0 comments on commit a448f36

Please sign in to comment.