Skip to content

Paywall callbacks not being called on iOS #832

Description

@MrJohn10

On iOS the onPurchaseStarted and onPurchaseCompleted are not being called.
On Android they work as expected.

code sample:

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
            }

version: purchases-kmp = "2.10.2+17.55.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions