Hello,
In the latest SDK 7.1.0, how can I obtain the days of a free trial? Currently I’m hardcoding it like this to “3 Days Free Trial”:
private fun fillTrialOrNormal(it: Package) {
if (isAdded) {
val hasFreeTrial = it.product.subscriptionOptions?.freeTrial != null
Utilities().checkTrialUsedUp(it.product.id, hasFreeTrial) { trialUsedUp ->
val title: String
val header: String
if (trialUsedUp) {
title = "${it.product.price.formatted} / Year"
header = getString(R.string.upgrade_to_premium)
binding.premiumTextId.text = header
} else {
title =
"Start Your 3 Days Free Trial,\nThen ${it.product.price.formatted} / Year"
}
binding.trialPurchaseButtonId.text = title
binding.trialPurchaseButtonId.isEnabled = true
}
}
}
Many Thanks