From d14a3ba04a590b75c501a96d0f02fb5adb64e863 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Sat, 15 Aug 2026 00:44:37 +0400 Subject: [PATCH] wip --- .../android/src/google/java/chat/simplex/app/PlayStore.kt | 5 +++++ .../kotlin/chat/simplex/common/views/badges/BadgesPayView.kt | 3 ++- .../common/src/commonMain/resources/MR/base/strings.xml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/android/src/google/java/chat/simplex/app/PlayStore.kt b/apps/multiplatform/android/src/google/java/chat/simplex/app/PlayStore.kt index 125f8351f0..13754286aa 100644 --- a/apps/multiplatform/android/src/google/java/chat/simplex/app/PlayStore.kt +++ b/apps/multiplatform/android/src/google/java/chat/simplex/app/PlayStore.kt @@ -49,6 +49,11 @@ suspend fun loadBadgeProducts(productIds: List): List { // does not have to be inferred from the id val details = queryBadgeProducts(client, productIds, BillingClient.ProductType.INAPP) + queryBadgeProducts(client, productIds, BillingClient.ProductType.SUBS) + if (details.size < productIds.size) { + // Play drops ids it cannot resolve without saying why, so the package it was asked for and the + // store country are logged with them - a debug build's applicationIdSuffix is a common cause + Log.w(TAG, "loadBadgeProducts: Play returned ${details.size} of ${productIds.size} - package ${androidAppContext.packageName}, country ${androidPlayStoreCountry.value ?: "none"}") + } badgeProductDetails = details.associateBy { it.productId } return details.mapNotNull { it.badgeProduct() } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt index 95931bb588..165308198b 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt @@ -163,7 +163,8 @@ private fun PeriodCard(level: BadgeLevel, period: BadgePeriod, selectedPeriod: B val percent = savingsPercent(level, period) if (percent != null) { Text( - stringResource(MR.strings.badges_savings).format(percent), + // the percent sign is in the argument, not the resource: adjustFormatting rejects %% + stringResource(MR.strings.badges_savings).format("$percent%"), style = MaterialTheme.typography.caption, color = if (isSelected) MaterialTheme.colors.primary else MaterialTheme.colors.secondary, textAlign = TextAlign.Center diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml index edc7bd73df..046d490863 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -3212,7 +3212,7 @@ Pay %1$s Loading… Not available - Save %1$d%% + Save %1$s Optional profile badge\nand 2GB files Optional profile badge\nand 5GB files 1 month