return PaywallOptions(
dismissRequest = {
onDismiss()
}
) {
var productPrice: Long? = null
var isProductSubscription: Boolean? = null
shouldDisplayDismissButton = displayDismissButton
listener = object : PaywallListener {
override fun onPurchaseCompleted(
customerInfo: CustomerInfo,
storeTransaction: StoreTransaction
) {
analytics.trackEvent(
actionName = "Paywall Callback",
properties = mapOf(
"value" to "purchase completed",
"ingress" to ingress,
"product_id" to (storeTransaction.productIds.firstOrNull()
?: "unknown"),
)
)
// we only show app review when user bought product not for free, or trial
if (((productPrice ?: 0L) > 0L) || isProductSubscription == true) {
requestReview("Purchase Completed")
}
// the paywall calls navigate back itself
}
On iOS the
onPurchaseStartedandonPurchaseCompletedare not being called.On Android they work as expected.
code sample:
version:
purchases-kmp = "2.10.2+17.55.1"