ui: redeem code (#7482)

This commit is contained in:
spaced4ndy
2026-09-15 14:23:13 +00:00
committed by GitHub
parent a7aed3ebd5
commit 6a7eae2751
76 changed files with 1590 additions and 781 deletions
@@ -9,6 +9,8 @@ import chat.simplex.common.views.badges.BadgeStoreProductId
// Play Billing is only in the google flavor, so the Play country stays unknown here
fun loadPlayStoreCountry() {}
const val hasPlatformStore = false
// No store in this flavor: no product is offered, so the purchase screen shows nothing to buy
// TODO [badges] this build pays via Stripe/crypto - the badge service catalog replaces these
@Suppress("UNUSED_PARAMETER")
@@ -10,6 +10,8 @@ import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
const val hasPlatformStore = true
// Requests the country of the Google Play account into [androidPlayStoreCountry].
// It stays null when Play is unavailable or the user is not signed in.
fun loadPlayStoreCountry() {
@@ -346,6 +346,8 @@ class SimplexApp: Application(), LifecycleEventObserver {
override fun androidLoadPlayStoreCountry() = loadPlayStoreCountry()
override val androidHasPlatformStore: Boolean get() = hasPlatformStore
override suspend fun androidLoadBadgeProducts(oneTimeIds: List<BadgeStoreProductId>, subscriptionIds: List<BadgeStoreProductId>): List<BadgeProduct> = loadBadgeProducts(oneTimeIds, subscriptionIds)
override suspend fun androidPurchaseBadge(id: BadgeStoreProductId, invoiceId: String): BadgePurchaseOutcome = purchaseBadge(id, invoiceId)