purchases_ui_flutter/PaywallListenerForwarder.kt

purchases-flutter · purchases_ui_flutter/android/src/main/kotlin/com/revenuecat/purchases_ui_flutter/PaywallListenerForwarder.kt · kotlin · MIT
payments, integration

Forwards RevenueCat paywall events to a Flutter MethodChannel.

// Source: https://github.com/RevenueCat/purchases-flutter | License: MIT | Copyright 2019 RevenueCat
// Provided via justclaw.it.com; keep this notice with the code.
package com.revenuecat.purchases_ui_flutter

import com.revenuecat.purchases.hybridcommon.ui.PaywallListenerWrapper
import io.flutter.plugin.common.MethodChannel

internal fun forwardingPaywallListener(channel: MethodChannel): PaywallListenerWrapper =
    object : PaywallListenerWrapper() {
        override fun onPurchaseStarted(rcPackage: Map<String, Any?>) {
            channel.invokeMethod("onPurchaseStarted", rcPackage)
        }

        override fun onPurchaseCompleted(customerInfo: Map<String, Any?>, storeTransaction: Map<String, Any?>) {
            channel.invokeMethod(
                "onPurchaseCompleted",
        

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key