show toast if download is greater than 0
This commit is contained in:
@@ -66,12 +66,15 @@ class DashboardActivity : AppCompatActivity() {
|
|||||||
val firebaseAppDistribution = FirebaseAppDistribution.getInstance()
|
val firebaseAppDistribution = FirebaseAppDistribution.getInstance()
|
||||||
firebaseAppDistribution.updateIfNewReleaseAvailable()
|
firebaseAppDistribution.updateIfNewReleaseAvailable()
|
||||||
.addOnProgressListener { updateProgress ->
|
.addOnProgressListener { updateProgress ->
|
||||||
|
|
||||||
|
if (updateProgress.apkBytesDownloaded > 0) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
this,
|
this,
|
||||||
"${updateProgress.updateStatus}. ${updateProgress.apkBytesDownloaded / 1048576} /${updateProgress.apkFileTotalBytes / 1048576} MB",
|
"${updateProgress.updateStatus}. ${updateProgress.apkBytesDownloaded / 1048576} /${updateProgress.apkFileTotalBytes / 1048576} MB",
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.addOnFailureListener { e ->
|
.addOnFailureListener { e ->
|
||||||
// (Optional) Handle errors.
|
// (Optional) Handle errors.
|
||||||
if (e is FirebaseAppDistributionException) {
|
if (e is FirebaseAppDistributionException) {
|
||||||
@@ -82,7 +85,11 @@ class DashboardActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
// Handle other errors.
|
// Handle other errors.
|
||||||
Toast.makeText(this, "AppDistribution error, status: ${e.errorCode}", Toast.LENGTH_SHORT).show()
|
Toast.makeText(
|
||||||
|
this,
|
||||||
|
"AppDistribution error, status: ${e.errorCode}",
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FirebaseCrashlytics.getInstance().recordException(e)
|
FirebaseCrashlytics.getInstance().recordException(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user