Add PurchaseLogic support to PaywallView#715
Merged
Merged
Conversation
tonidero
reviewed
Mar 4, 2026
Contributor
tonidero
left a comment
There was a problem hiding this comment.
Looking great! I just noticed that the API we've added might be wrong since we've been adding a new one in Android native 😱... I think it would be great to use that same API so it's easier to extend it now that it's not merged. Changing that without breaking changes later would be a pain :(
7e339ac to
107296c
Compare
tonidero
reviewed
Mar 6, 2026
tonidero
reviewed
Mar 6, 2026
Contributor
tonidero
left a comment
There was a problem hiding this comment.
Just a comment from an issue we have in android, but looking great!
JayShortway
reviewed
Mar 6, 2026
Adds the ability for developers to provide custom purchase and restore logic to PaywallView via the new PaywallPurchaseLogic interface, matching the implementations in Flutter (PR #1657) and React Native (PR #1607). - Add PaywallPurchaseLogic interface and PurchaseLogicResult sealed class - Add purchaseLogic property to PaywallOptions - Implement iOS bridge via PaywallProxy + HybridPurchaseLogicBridge - Implement Android support via performPurchase/performRestore lambdas - Add SamplePurchaseLogic to the sample app with compile-time flag - Add API tester for the new public API surface
- Change performPurchase to accept PaywallPurchaseLogicParams instead of plain Package, matching Android's PaywallPurchaseLogicParams (wrapping package, product change info, and subscription option) - Change performRestore to accept CustomerInfo parameter - Change PurchaseLogicResult from sealed interface to abstract class for future extensibility without breaking changes - Change Error.errorMessage to Error.errorDetails (PurchasesError?) to match Android's richer error type - Add PaywallPurchaseLogicParams class with Builder - Update Android/iOS wrappers, sample app, and API tester - Regenerate API dump
…walls Use PaywallProxy + createPaywallViewWithParams for both standard and custom-purchase-logic paywalls, eliminating the separate code path that used RCPaywallViewController directly. The footer path remains unchanged since PaywallProxy doesn't support PaywallViewCreationParams for footers.
cb8e620 to
bfa1445
Compare
tonidero
approved these changes
Mar 9, 2026
Contributor
tonidero
left a comment
There was a problem hiding this comment.
All the code makes sense to me. Amazing job! 🚢
bfa1445 to
99372f8
Compare
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
PaywallPurchaseLogicinterface andPurchaseLogicResultsealed class, allowing developers to provide custom purchase and restore logic toPaywallViewpurchaseLogicproperty toPaywallOptionsPaywallProxy+HybridPurchaseLogicBridgeperformPurchase/performRestorelambdasSamplePurchaseLogicto the sample app with a compile-timepurchasesAreCompletedByMyAppflagRelated PRs
Test plan
purchasesAreCompletedByMyAppinDefaults.ktand verify custom purchase logic is invoked