From fc8aa161051c79ec1791e06e851eeba828d24830 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 2 Aug 2022 16:13:55 +0100 Subject: [PATCH] using build meta for application id --- .../java/im/vector/app/nightly/FirebaseNightlyProxy.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/gplay/java/im/vector/app/nightly/FirebaseNightlyProxy.kt b/vector/src/gplay/java/im/vector/app/nightly/FirebaseNightlyProxy.kt index 59a1e3eb17..11ec2f8580 100644 --- a/vector/src/gplay/java/im/vector/app/nightly/FirebaseNightlyProxy.kt +++ b/vector/src/gplay/java/im/vector/app/nightly/FirebaseNightlyProxy.kt @@ -20,8 +20,8 @@ import android.content.SharedPreferences import androidx.core.content.edit import com.google.firebase.appdistribution.FirebaseAppDistribution import com.google.firebase.appdistribution.FirebaseAppDistributionException -import im.vector.app.BuildConfig import im.vector.app.core.di.DefaultPreferences +import im.vector.app.core.resources.BuildMeta import im.vector.app.core.time.Clock import im.vector.app.features.home.NightlyProxy import timber.log.Timber @@ -31,7 +31,8 @@ class FirebaseNightlyProxy @Inject constructor( private val clock: Clock, @DefaultPreferences private val sharedPreferences: SharedPreferences, -) : NightlyProxy { + private val buildMeta: BuildMeta, +): NightlyProxy { override fun onHomeResumed() { if (!canDisplayPopup()) return @@ -58,7 +59,7 @@ class FirebaseNightlyProxy @Inject constructor( } private fun canDisplayPopup(): Boolean { - if (BuildConfig.APPLICATION_ID != "im.vector.app.nightly") return false + if (buildMeta.applicationId != "im.vector.app.nightly") return false val today = clock.epochMillis() / A_DAY_IN_MILLIS val lastDisplayPopupDay = sharedPreferences.getLong(SHARED_PREF_KEY, 0) return (today > lastDisplayPopupDay)