Skip to content

Commit 5583fa7

Browse files
authored
Merge pull request #256 from Automattic/update/enable-free-trial-feature-flag
Update/enable free trial feature flag
2 parents 0c746b7 + 9a321fa commit 5583fa7

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

base.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ android {
3131
buildConfigField "String", "SETTINGS_ENCRYPT_SECRET", "\"${project.properties["pocketcastsSettingsEncryptSecret"] ?: ""}\""
3232
buildConfigField "String", "SHARING_SERVER_SECRET", "\"${project.properties["pocketcastsSharingServerSecret"] ?: ""}\""
3333

34-
buildConfigField "boolean", "ENABLE_FREE_TRIAL", "false"
35-
3634
testInstrumentationRunner project.testInstrumentationRunner
3735
testApplicationId "au.com.shiftyjelly.pocketcasts.test" + project.name.replace("-", "_")
3836
vectorDrawables.useSupportLibrary = true

modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/subscription/SubscriptionManager.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ interface SubscriptionManager {
1818
const val PLUS_PRODUCT_BASE = "com.pocketcasts.plus"
1919
const val MONTHLY_PRODUCT_ID = "$PLUS_PRODUCT_BASE.monthly"
2020
const val YEARLY_PRODUCT_ID = "$PLUS_PRODUCT_BASE.yearly"
21-
const val TEST_FREE_TRIAL_PRODUCT_ID = "$PLUS_PRODUCT_BASE.testfreetrialoffer"
2221
}
2322

2423
fun signOut()

modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/subscription/SubscriptionManagerImpl.kt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import au.com.shiftyjelly.pocketcasts.models.type.SubscriptionPlatform
99
import au.com.shiftyjelly.pocketcasts.models.type.SubscriptionPricingPhase
1010
import au.com.shiftyjelly.pocketcasts.models.type.SubscriptionType
1111
import au.com.shiftyjelly.pocketcasts.preferences.Settings
12-
import au.com.shiftyjelly.pocketcasts.repositories.BuildConfig
1312
import au.com.shiftyjelly.pocketcasts.repositories.subscription.SubscriptionManager.Companion.MONTHLY_PRODUCT_ID
1413
import au.com.shiftyjelly.pocketcasts.repositories.subscription.SubscriptionManager.Companion.PLUS_PRODUCT_BASE
15-
import au.com.shiftyjelly.pocketcasts.repositories.subscription.SubscriptionManager.Companion.TEST_FREE_TRIAL_PRODUCT_ID
1614
import au.com.shiftyjelly.pocketcasts.repositories.subscription.SubscriptionManager.Companion.YEARLY_PRODUCT_ID
1715
import au.com.shiftyjelly.pocketcasts.servers.sync.SubscriptionPurchaseRequest
1816
import au.com.shiftyjelly.pocketcasts.servers.sync.SubscriptionResponse
@@ -158,16 +156,7 @@ class SubscriptionManagerImpl @Inject constructor(private val syncServerManager:
158156
.setProductId(YEARLY_PRODUCT_ID)
159157
.setProductType(BillingClient.ProductType.SUBS)
160158
.build(),
161-
).apply {
162-
if (isFreeTrialEligible()) {
163-
add(
164-
QueryProductDetailsParams.Product.newBuilder()
165-
.setProductId(TEST_FREE_TRIAL_PRODUCT_ID)
166-
.setProductType(BillingClient.ProductType.SUBS)
167-
.build()
168-
)
169-
}
170-
}
159+
)
171160

172161
val params = QueryProductDetailsParams.newBuilder()
173162
.setProductList(productList)
@@ -343,7 +332,7 @@ class SubscriptionManagerImpl @Inject constructor(private val syncServerManager:
343332
subscriptionStatus.accept(Optional.empty())
344333
}
345334

346-
override fun isFreeTrialEligible() = freeTrialEligible && BuildConfig.ENABLE_FREE_TRIAL
335+
override fun isFreeTrialEligible() = freeTrialEligible
347336

348337
override fun updateFreeTrialEligible(eligible: Boolean) {
349338
freeTrialEligible = eligible

0 commit comments

Comments
 (0)