Offer a free trial on your paywall
To offer a free trial with BillDog, create the trial as an introductory offer in App Store Connect and Google Play Console, then put {{ selectedProduct.trialPeriodText }} on your paywall. The SDK reads the trial from the store and shows it only to users who can still take it, under the paywall's Show Free Trial setting. After purchase, CustomerInfo.isInTrial and the entitlement's entitlementState tell you the user is in a trial.
Steps last checked against the SDK source on 16 Nov 2026.
What you'll build
- A free trial set up in App Store Connect and Google Play Console
- A paywall whose trial text appears only for eligible users
- App code that knows when a user is in a trial and when it ends
- A tested trial that starts, converts and shows up in the dashboard
What you'll need
- An app that shows a paywall from the
onboardingplacement (iOS, Android, Flutter or React Native codelab) - Subscriptions connected to BillDog (App Store setup, Google Play setup)
1. Create the trial in each store
8 minA free trial is a store feature. The App Store and Google Play decide who can take it and charge the user when it ends. BillDog reads it from the store, so there is nothing to switch on in the SDK.
- App Store Connect: open your subscription and add an introductory offer to its prices. Choose the countries, a start date, the free offer type and a duration such as one week. A user can take one introductory offer per subscription group.
- Google Play Console: open your subscription, pick the base plan and add an offer. Set its eligibility to new customer acquisition and add a free trial phase, for example 7 days. Activate the offer.
On Google Play, a BillDog product whose Play Store Product ID is the bare subscription id or subscriptionId:basePlanId gets the trial automatically: the SDK picks the offer with the longest free trial on that base plan (for a bare id, the first base plan Play lists). You only pin an offer (subscriptionId:basePlanId:offerId) when you want a specific one. See Google Play setup.
2. Set the trial length in BillDog
2 minOpen Monetization → Products, click the pencil icon on the product's row, set Trial Duration (Days) to the store trial's length, for example 7, and click Save Changes. On a phone the trial itself always comes from the store. This field feeds BillDog's own uses of the trial:
- BillDog's server-side eligibility check. When the field is empty it answers "no trial available", which can hide trial text on Android.
- Stripe web checkout, where it is the trial length granted, once per customer per product.
- The Paywall Builder canvas, which uses it to preview trial text.
3. Show trial terms on the paywall
6 minOpen your paywall in Paywalls & Funnels. Click Variables in the left rail and expand Product Variables to see the trial keys. The copy button puts a token such as {{ selectedProduct.trialPeriodText }} on your clipboard; paste it into a text component.
selectedProduct.trialPeriodText: ready-made text such as "7-day free trial" or "2-week free trial". Empty when there's no trial to show.selectedProduct.trialPeriod: the length alone, such as "1 week".selectedProduct.trialPeriodDaysis the number of days.selectedProduct.hasFreeTrial: true when the trial is shown for this user.selectedProduct.introPriceandselectedProduct.introPeriod: a paid introductory price, if your offer has one.selectedProduct.priceandselectedProduct.periodShort(/mo): the price after the trial.
{{ selectedProduct.trialPeriodText }}
Then {{ selectedProduct.price }}{{ selectedProduct.periodShort }}. Cancel anytime.Put the trial token on its own line. For a user who can't take the trial it resolves to an empty string, so the line disappears and the price line still reads correctly.
Next, click Settings in the left rail. Under App Store Integration, Show Free Trial and Show Intro Price each have three modes:
- Auto (the default, and the one to use): show the offer only when the store says this user can take it.
- Never: always hide the offer text.
- Always: show the offer text even to users the store says can't take it. Those users are charged the full price straight away, so don't use this for a trial.
Click Publish when you're done. The builder's canvas previews an eligible user (trial length from Trial Duration (Days)), so check the ineligible case on a device, as in step 6.
How "the store says" works differs by platform. On iOS the SDK asks StoreKit, and an unknown answer hides the trial. On Android, Google Play only lists offers the user can take, and BillDog's server check can hide a trial the user already used in your app.
4. Optional: check eligibility in your own UI
4 minA hosted paywall does this for you. If your own screen also says "Start free trial", ask before you show it. On iOS, checkTrialOrIntroEligibility(productIds:) asks StoreKit. It doesn't throw, takes App Store product ids or BillDog package ids, and returns a dictionary keyed by the ids you passed.
import BillDogFull
func trialButtonTitle() async -> String {
let id = "premium_monthly" // your App Store product id
let result = await BillDog.shared.checkTrialOrIntroEligibility(productIds: [id])
switch result[id] {
case .eligible?:
return "Start free trial"
case .ineligible?:
return "Subscribe"
default:
return "Subscribe" // .unknown or missing: don't promise a trial
}
}On Android, BillDog.checkTrialOrIntroEligibility never returns ELIGIBLE, because Play Billing has no purchase history to check. Ask BillDog's server instead. Pass the BillDog Product Identifier; the answer depends on Trial Duration (Days) from step 2 and on the user's past subscriptions to that product.
import android.util.Log
import androidx.lifecycle.lifecycleScope
import io.billdog.core.BillDog
import kotlinx.coroutines.launch
// Inside your Activity
fun refreshTrialButton() {
lifecycleScope.launch {
val id = "premium-monthly" // the BillDog Product Identifier
BillDog.getTrialEligibilityManager()
.checkTrialEligibility(listOf(id))
.onSuccess { answers ->
val eligible = answers[id]?.isEligible == true
showTrialButton(eligible) // your own UI function
}
.onFailure { Log.w("BillDog", "Eligibility check failed", it) }
}
}5. Know when a user is in a trial
4 minA trial unlocks the entitlement like a paid subscription, so hasEntitlement("premium") is already true. To tell trials apart, for example to show "Your trial ends on…", read two fields from customer info:
isInTrialonCustomerInfo: true while any active subscription is in its trial period.entitlementStateon the entitlement:.trialon iOS,EntitlementState.TRIALon Android. While it's in a trial,expiresAtis when the trial ends andwillRenewsays whether it will convert.
import BillDogFull
func printTrialStatus() async {
do {
let info = try await BillDog.shared.getCustomerInfo(forceRefresh: true)
guard let premium = info.entitlements.first(where: { $0.identifier == "premium" && $0.isActive }) else {
print("No active premium")
return
}
if premium.entitlementState == .trial {
print("Trial ends:", premium.expiresAt ?? "unknown",
"converts:", premium.willRenew)
} else {
print("Paid subscriber. Any trial:", info.isInTrial)
}
} catch {
print("Customer info failed: \(error)")
}
}import android.util.Log
import androidx.lifecycle.lifecycleScope
import io.billdog.core.BillDog
import io.billdog.core.models.EntitlementState
import kotlinx.coroutines.launch
// Inside your Activity
fun logTrialStatus() {
lifecycleScope.launch {
BillDog.getCustomerInfo(forceRefresh = true)
.onSuccess { info ->
val premium = info.entitlements.firstOrNull { it.identifier == "premium" && it.isActive }
when {
premium == null -> Log.d("BillDog", "No active premium")
premium.entitlementState == EntitlementState.TRIAL ->
Log.d("BillDog", "Trial ends ${premium.expiresAt}, converts: ${premium.willRenew}")
else -> Log.d("BillDog", "Paid subscriber. Any trial: ${info.isInTrial}")
}
}
.onFailure { Log.e("BillDog", "Customer info failed", it) }
}
}BillDog sets the trial status from the store's own data: Apple's free-trial offer type and Google Play's free-trial phase. When the trial converts, the store's renewal moves the subscription to active and isInTrial becomes false.
6. Test the trial end to end
10 min- Use a sandbox build with the
bd_public_test_YOUR_KEYkey and a store test account: a sandbox Apple Account (iOS sandbox testing) or a license tester (Android sandbox testing). - Open the paywall. The trial line should show, and the store's purchase sheet should state the free period before any charge.
- Buy. Then switch the dashboard header to Sandbox, open Audience → Customers and find the user. On the Subscriptions tab the subscription's status is
trial, and your app'sisInTrialis true. - Wait for the trial to end. Test trials are short: in Apple's sandbox a one-week trial lasts a few minutes, and Google Play test trials last about 3 minutes. After the store renews, the status moves to
active. - Open the paywall again with the same account. The trial line should be gone.
A test account that already used the trial stays ineligible. To see the trial again, clear the sandbox tester's purchase history in App Store Connect or use a new tester; on Google Play, use another license tester account.
To test your backend and webhooks without a device, the Test Store has a Free trial, converts at its end scenario. Once real trials come in, Analytics → Trial Conversion shows how many convert, and a journey with the Trial Ending trigger under Engagement → Journeys can remind users before they're charged.