#Variables
Some texts inside the paywall benefit from predefined & automatically integrated variables, such as {app_name}
.
The .variable
function allows you to define custom variables, which can be used in all paywall texts.
#Usage
fun variables(key: String, value: Any? = null): Access
fun variables(variables: Map<String, Any>): Access
Example.kt
import tech.poool.access.Access
val access = Access("<your_app_id>")
access.variables("year", Calendar.getInstance().get(Calendar.YEAR))
access.texts(
"subscription_desc",
"Happy new year {year}! Take advantage of the New Year to discover our new offers!"
)
access.variables(mapOf(
"remaining" to 1,
"total" to 6
))
access.texts("gift_desc", "You have {remaining} article to read, out of {total}")