Add PaywallListener convenience prop to PaywallView components#1632
Add PaywallListener convenience prop to PaywallView components#1632rickvdl wants to merge 1 commit intorickvdl/add-purchase-logic-support-to-paywallviewfrom
Conversation
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; |
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).
There was a problem hiding this comment.
Yeah that's a valid point, I've deprecated the old ones in favor of the listener in the new PR here
| * completion, restoration, and errors. | ||
| * Individual callback props take precedence over listener callbacks. | ||
| */ | ||
| listener?: PaywallListener; |
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.
There was a problem hiding this comment.
Right, I think it does make sense to at least keep these in sync, since the footer already supports the methods I went ahead and just did the same as we did for the regular paywall view here
|
This PR was accidentally closed. Reopened as #1633. |
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)