diff --git a/app/src/main/java/net/pokeranalytics/android/ui/fragment/SubscriptionFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/fragment/SubscriptionFragment.kt index c83dd78f..2626d5e0 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/fragment/SubscriptionFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/fragment/SubscriptionFragment.kt @@ -56,14 +56,16 @@ class SubscriptionFragment : PokerAnalyticsFragment(), SkuDetailsResponseListene val isConnected: Boolean = activeNetwork?.isConnected == true if (!isConnected) { - Toast.makeText(requireContext(), R.string.billingclient_unavailable, Toast.LENGTH_LONG).show() + Toast.makeText(requireContext(), R.string.connection_unavailable, Toast.LENGTH_LONG).show() return } this.showLoader(R.string.loading_please_wait) if (!AppGuard.requestProducts(this)) { this.hideLoader() - Toast.makeText(requireContext(), R.string.billingclient_unavailable, Toast.LENGTH_LONG).show() + var message = requireContext().getString(R.string.billing_client_unavailable) + message += " [code=${AppGuard.billingResponseCode}]" + Toast.makeText(requireContext(), message, Toast.LENGTH_LONG).show() } } diff --git a/app/src/main/java/net/pokeranalytics/android/util/billing/AppGuard.kt b/app/src/main/java/net/pokeranalytics/android/util/billing/AppGuard.kt index 0f287e15..cf4afdc4 100644 --- a/app/src/main/java/net/pokeranalytics/android/util/billing/AppGuard.kt +++ b/app/src/main/java/net/pokeranalytics/android/util/billing/AppGuard.kt @@ -44,6 +44,11 @@ object AppGuard : PurchasesUpdatedListener { */ private var billingClientAvailable: Boolean = false + /** + * The code of the billing request response + */ + var billingResponseCode: Int? = null + /** * Returns the true state of the user's pro subscription */ @@ -59,7 +64,7 @@ object AppGuard : PurchasesUpdatedListener { if (this.endOfUse != null) return true return if (BuildConfig.DEBUG) { - true + false //true } else { this._isProUser } @@ -105,6 +110,8 @@ object AppGuard : PurchasesUpdatedListener { billingClient.startConnection(object : BillingClientStateListener { override fun onBillingSetupFinished(@BillingClient.BillingResponse billingResponseCode: Int) { + + this@AppGuard.billingResponseCode = billingResponseCode if (billingResponseCode == BillingClient.BillingResponse.OK) { // The BillingClient is ready. You can query purchases here. billingClientAvailable = true diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d0d5268c..68cd5834 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -10,7 +10,8 @@ Valeur initiale Il faut au moins deux valeurs pour afficher ce rapport! L\'objet est invalide - Les services de paiement sont indisponibles. Veuillez vérifier votre connexion internet et réessayez plus tard. + Il semblerait que vous n\'êtes pas connectés à Internet. Veuillez vérifier votre connexion et réessayez plus tard. + Les services de paiement sont indisponibles. Veuillez réessayer plus tard ou contactez-nous. Devenez membre Pro Passer Pro d\'essai gratuit diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a196d228..6c611102 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,7 +11,8 @@ Initial Value Can\'t show because there is less than two values to display! The object you\'re trying to access is invalid - The billing services are unavailable at the moment. Please check your internet connection and retry later. + It appears that you are not connected at the moment. Please check your internet connection and retry later. + The billing services are unavailable at the moment. Please retry later or contact us. Upgrade to Pro Go Pro free trial