-
Notifications
You must be signed in to change notification settings - Fork 49
Description
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.