You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, an app we're building is using RevenueCat with Superwall Paywalls. So, we created a controller (inspired from the Superwall + RC example) that allows the callbacks and purchases to be synced. We register the controller delegate in a global screen/page with many sub widgets/places where a paywall can be presented.
Problem
We find it challenging for us to truly know if the user bought a subscription at the time when the paywall is presented using the handler only. We need to keep track of the interactions where (feature or section in the app) paywall was called and user was able to complete it or not.
We're aware that we can potentially get the "completed state" using subscriptionStatusDidChange, but that does not guarantee return if the subscription status was changed because of the paywall or something else (outside the app).
Proposal
The proposal is to have a handler callback if purchased has been made at the time the paywall is registered and presented:
// Initialize the handler
final handler = PaywallPresentationHandler();
handler
..onPresent((paywallInfo) async {
... (do something here)
})
/// Have this included in the presentation handler
..onComplete((paywallInfo) async {
... (handle when the user purchases a paywall)
})
..onSkip((paywallInfo) async {
... (do something here)
})
..onDismiss((paywallInfo) async {
... (do something here)
})
..onError((error) {
... (do something here)
})
..onSkip(_handlePaywallSkipReason);
// Present the paywall
await Superwall.shared.registerEvent(
feature.identifier,
handler: handler,
feature: ... // In the SDK, this method is not aware of any subscription changes, it just handle the gating logic internally
);
Let me know what you think!
The text was updated successfully, but these errors were encountered:
Great idea! I'm currently facing the same issue and have come to the same conclusion — something like 'onComplete' needs to be there. Hopefully, it will be added soon.
Description
Currently, an app we're building is using RevenueCat with Superwall Paywalls. So, we created a controller (inspired from the Superwall + RC example) that allows the callbacks and purchases to be synced. We register the controller delegate in a global screen/page with many sub widgets/places where a paywall can be presented.
Problem
We find it challenging for us to truly know if the user bought a subscription at the time when the paywall is presented using the handler only. We need to keep track of the interactions where (feature or section in the app) paywall was called and user was able to complete it or not.
We're aware that we can potentially get the "completed state" using
subscriptionStatusDidChange
, but that does not guarantee return if the subscription status was changed because of the paywall or something else (outside the app).Proposal
The proposal is to have a handler callback if purchased has been made at the time the paywall is registered and presented:
Let me know what you think!
The text was updated successfully, but these errors were encountered: