Skip to content

[FEATURE REQUEST] Provide paywall view controller in SuperwallDelegate.handleCustomPaywallAction #294

@vrutberg

Description

@vrutberg

We're currently integrating with Superwall, and have come up with a possible improvement in the SDK. We've looked around in the SDK and documentation and haven't found a straightforward way to achieve what we are suggesting, but of course we might have missed an obvious solution to this problem. In that case, feel free to close this issue.

Is your feature request related to a problem? Please describe.
We're implementing a paywall with some custom actions that leads to navigation within the app. In some cases, these custom actions will lead to something being pushed on the navigation stack of the paywall view controller. To avoid bookkeeping of what paywall view controller is being presented, it would be nice to receive this information from the SDK.

Describe the solution you'd like
I'm thinking that the delegate method handleCustomPaywallAction of SuperwallDelegate could be augmented with another argument: in paywallViewController: PaywallViewController.

Before:

extension SuperwallManager: SuperwallDelegate {
    func handleCustomPaywallAction(withName name: String) {
        switch action {
        case "feedback":
            // How do I push something on to the navigation stack from here?
            break
        default:
            break
        }
    }
}

After:

extension SuperwallManager: SuperwallDelegate {
    func handleCustomPaywallAction(
        withName name: String,
        in paywallViewController: PaywallViewController
    ) {
        switch action {
        case "feedback":
            paywalViewController.navigationController?.pushViewController(..., animated: true)
        default:
            break
        }
    }
}

Describe alternatives you've considered
It is possible to do some bookkeeping to keep track of the current paywall being presented, and push on the navigation stack. It's just more work.

Another alternative could be to move this delegate method to the PaywallViewControllerDelegate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions