Closed mcg95 closed 5 years ago
2.x.x
8.0
Samsung
Galaxy S7 EDGE
private fun checkAppUpdate(){ val appUpdaterUtils = AppUpdaterUtils(this) .setUpdateJSON(jsonURL) .withListener(object : AppUpdaterUtils.UpdateListener { override fun onSuccess(update: Update, isUpdateAvailable: Boolean?) { Log.d("Latest Version", update.latestVersion) Log.d("Latest Version Code", update.latestVersionCode.toString()) Log.d("Release notes", update.releaseNotes) Log.d("URL", update.urlToDownload.toString()) Log.d("Is update available?", java.lang.Boolean.toString(isUpdateAvailable!!)) if (update.latestVersionCode > BuildConfig.VERSION_CODE.toString()) { appUpdater = AppUpdater(this@LoginActivity) appUpdater?.setCancelable(false)?.setIcon(R.drawable.hauz_security_icon_round)?.setButtonDoNotShowAgain("")?.setButtonDismiss("")?.setDisplay(Display.DIALOG)?.setUpdateJSON(jsonURL)?.start() } } override fun onFailed(error: AppUpdaterError) { Log.d("AppUpdater Error", "Something went wrong") } }) appUpdaterUtils.start() }
update.latestVersionCode = 23
update.latestVersionCode = Null
JSON Format: Tried { "latestVersion": "1.0.0", "latestVersionCode": 23, "url": "https://play.google.com/store/apps/details?id=com.hauz.hauzclocking", "releaseNotes": [ "- Fixed minor issues" ] }
AND
{ "latestVersion": "1.0.0", "latestVersionCode": 23, "url": "https://play.google.com/store/apps/details?id=com.hauz.hauzclocking", "releaseNotes": [ "- Fixed minor issues" ] }
Difference being latestVersionCode was changed from Int to String. Still no luck. Looked through all the older issues, none of them seemed to face an issue like this except one person. But there was no solution mentioned in the issue.
Issue: https://github.com/javiersantos/AppUpdater/issues/118
Managed to solve it, I forgot to include setUpdateFrom(UpdateFrom.Json) in the builder.
Details
2.x.x
8.0
Samsung
Galaxy S7 EDGE
Builder
Reproduction Steps
Expected Result
update.latestVersionCode = 23
Actual Result
update.latestVersionCode = Null
JSON Format: Tried { "latestVersion": "1.0.0", "latestVersionCode": 23, "url": "https://play.google.com/store/apps/details?id=com.hauz.hauzclocking", "releaseNotes": [ "- Fixed minor issues" ] }
AND
{ "latestVersion": "1.0.0", "latestVersionCode": 23, "url": "https://play.google.com/store/apps/details?id=com.hauz.hauzclocking", "releaseNotes": [ "- Fixed minor issues" ] }
Difference being latestVersionCode was changed from Int to String. Still no luck. Looked through all the older issues, none of them seemed to face an issue like this except one person. But there was no solution mentioned in the issue.
Issue: https://github.com/javiersantos/AppUpdater/issues/118