Add PaywallListener convenience prop to PaywallView components#1632
Open
rickvdl wants to merge 1 commit intorickvdl/add-purchase-logic-support-to-paywallviewfrom
Open
Add PaywallListener convenience prop to PaywallView components#1632rickvdl wants to merge 1 commit intorickvdl/add-purchase-logic-support-to-paywallviewfrom
rickvdl wants to merge 1 commit intorickvdl/add-purchase-logic-support-to-paywallviewfrom
Conversation
tonidero
approved these changes
Feb 26, 2026
Contributor
tonidero
left a comment
There was a problem hiding this comment.
I think this makes sense! It should make adding more callbacks much nicer as well in the future. Just a comment about deprecating the older APIs.
| * Individual callback props take precedence over listener callbacks. | ||
| */ | ||
| listener?: PaywallListener; | ||
| onPurchaseStarted?: ({packageBeingPurchased}: { packageBeingPurchased: PurchasesPackage }) => void; |
Contributor
There was a problem hiding this comment.
Should we deprecate these other methods in favor of using the listener? I think keeping both can be very confusing, that way we can move people to use our preferred approach (which I think should be the listener).
| * completion, restoration, and errors. | ||
| * Individual callback props take precedence over listener callbacks. | ||
| */ | ||
| listener?: PaywallListener; |
Contributor
There was a problem hiding this comment.
Hmm I do wonder whether we should add it to the footer... But I think it's ok to keep it. Same comment about deprecating older callbacks in favor of the listener though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaywallListenerandPurchaseResumableinterfaces matching the Capacitor SDK definitionslistenerprop toPaywallViewandPaywallFooterContainerViewas a convenience alternative to passing individual callback propsRelated PRs
Test plan
listenerprop onPaywallView— purchase/restore callbacks firelistenerdoesn't regress existing behavior (existing "Go to Paywall Screen" works as before)