Add WebCheckoutOpened result & handling#3536
Draft
alexrepty wants to merge 1 commit into
Draft
Conversation
Introduce WebCheckoutOpened to represent the user tapping a web checkout CTA and leaving the app. Add PaywallListener.onWebCheckoutOpened(), propagate a notifyWebCheckoutOpened() call through PaywallViewModel (impl calls listener), and have InternalPaywall call it and close the paywall with PaywallResult.WebCheckoutOpened when autoDismiss is true. Add a no-op override in LoadingViewModel, update MockViewModel to track calls/results, forward the event to user listeners in PaywallActivity, and add a test ensuring LaunchWebCheckout with autoDismiss closes with WebCheckoutOpened. Update api.txt to expose the new API surface.
Generated by 🚫 Danger |
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.
Introduce WebCheckoutOpened to represent the user tapping a web checkout CTA and leaving the app. Add PaywallListener.onWebCheckoutOpened(), propagate a notifyWebCheckoutOpened() call through PaywallViewModel (impl calls listener), and have InternalPaywall call it and close the paywall with PaywallResult.WebCheckoutOpened when autoDismiss is true. Add a no-op override in LoadingViewModel, update MockViewModel to track calls/results, forward the event to user listeners in PaywallActivity, and add a test ensuring LaunchWebCheckout with autoDismiss closes with WebCheckoutOpened. Update api.txt to expose the new API surface.
Checklist
purchases-iosand hybridsMotivation
Description
Note
Low Risk
Additive public API and clearer dismiss semantics for web checkout; limited to RevenueCat UI paywall flows with tests.
Overview
Adds a dedicated web checkout outcome so hosts can tell “user left for external payment” apart from cancelled or a completed in-app purchase.
PaywallResult.WebCheckoutOpenedis a new parcelable activity result.PaywallListener.onWebCheckoutOpened()fires after the checkout URL opens.PaywallViewModel.notifyWebCheckoutOpened()routes that to the listener; onLaunchWebCheckoutwithautoDismiss,InternalPaywallnow callsclosePaywall(PaywallResult.WebCheckoutOpened)instead of a generic dismiss.PaywallActivityforwards the listener callback; loading/mock view models implement the new API;api.txtand a compose test cover auto-dismiss + result.Reviewed by Cursor Bugbot for commit b455289. Bugbot is set up for automated code reviews on this repo. Configure here.