Skip to content

In-App Consumable Product can not be purchaced again #1881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.revenuecat.purchases.CustomerInfo
import com.revenuecat.purchases.ExperimentalPreviewRevenueCatPurchasesAPI
import com.revenuecat.purchases.Offering
import com.revenuecat.purchases.Package
import com.revenuecat.purchases.ProductType
import com.revenuecat.purchases.PurchaseParams
import com.revenuecat.purchases.PurchasesAreCompletedBy
import com.revenuecat.purchases.PurchasesError
Expand Down Expand Up @@ -250,7 +251,7 @@ internal class PaywallViewModelImpl(
when (val currentState = _state.value) {
is PaywallState.Loaded -> {
val selectedPackage = currentState.selectedPackage.value
if (!selectedPackage.currentlySubscribed) {
if (selectedPackage.rcPackage.product.type != ProductType.SUBS || !selectedPackage.currentlySubscribed) {
performPurchase(activity, selectedPackage.rcPackage)
} else {
Logger.d("Ignoring purchase request for already subscribed package")
Expand Down