-
Notifications
You must be signed in to change notification settings - Fork 9
2.7.0 #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Add support for OTP options and offers
Remove timeout event
…ctor Option picking refactor and tests
Post purchase actions
Fix date locale formatting for products
Add paywall state to paywall info
Fix late auth init issue with stripe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 1 comment
Add custom callbacks message and interface
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.
Changes in this pull request
2.7.0
Enhancements
Fixes
Deprecations
paywallWebviewLoad_timeout- this event was causing confusion due to it's naming, leading to it being deprecatedFixes
Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues.Greptile Overview
Greptile Summary
This release implements version 2.7.0 with significant enhancements to product selection, purchase flow control, and paywall state management. The changes introduce better support for Google Play Billing's one-time purchase options and provide more control over post-purchase paywall behavior.
Key Changes:
BasePlanTypeand refactoredOfferTypesealed classes to supportsw-auto,sw-none, and specific ID selection for both base plans and offersRawStoreProductwith newSelectedOfferDetailssealed class to unify handling of subscription offers and one-time purchase optionsshouldDismissparameter throughout purchase flow to enable post-purchase actions instead of automatic dismissalgetState()method that retrieves state from webview before dismissalfullIdentifier(includes base plan and offer) instead of justproductIdentifierpaywallWebviewLoad_timeoutevent to reduce confusionArchitecture Impact:
The product selection logic has been significantly refactored to handle the complexity of Google Play Billing's one-time purchase options (introduced in newer API versions), which can have multiple purchase options with different discount offers. The new sealed class approach provides type safety and clearer logic flow compared to the previous nullable string-based approach.
Confidence Score: 4/5
RawStoreProductis complex with multiple conditional branches that would benefit from additional integration testing to ensure all edge cases are coveredsuperwall/src/main/java/com/superwall/sdk/store/abstractions/product/RawStoreProduct.ktdue to complex conditional logic ingetSelectedOfferDetails()Important Files Changed
SelectedOfferDetails; addedBasePlanTypehandling andsw-noneoffer supportBasePlanTypesealed class to replace raw string handling; addedsw-noneoffer type support for explicitly selecting no offerBasePlanTypeand refactoredOfferTypewithNoneoption; both sealed classes have factory methods and helper propertiesshouldDismissparameter to purchase flow; addedgetState()method to retrieve paywall state from webview; addedTransactionCompleteevent handlingBasePlanTypeandOfferType; improved offer token handling for one-time purchases with purchase options; added automatic consumption of in-app purchasesidentifierattribute to usefullIdentifierinstead ofproductIdentifier; added separateproductIdentifierattributeSequence Diagram
sequenceDiagram participant User participant PaywallView participant PaywallMessageHandler participant WebView participant TransactionManager participant AutomaticPurchaseController participant BillingClient Note over User,BillingClient: Purchase Flow with shouldDismiss Parameter User->>PaywallView: Click Purchase Button PaywallView->>WebView: User initiates purchase WebView->>PaywallMessageHandler: PaywallMessage.Purchase(productId, shouldDismiss) PaywallMessageHandler->>PaywallMessageHandler: purchaseProduct(productId, shouldDismiss) PaywallMessageHandler->>PaywallView: PaywallWebEvent.InitiatePurchase(productId, shouldDismiss) PaywallView->>TransactionManager: purchase(product, shouldDismiss) TransactionManager->>AutomaticPurchaseController: purchase(productId) Note over AutomaticPurchaseController,BillingClient: Product Selection Logic AutomaticPurchaseController->>AutomaticPurchaseController: Parse DecomposedProductIds AutomaticPurchaseController->>AutomaticPurchaseController: Create RawStoreProduct(basePlanType, offerType) AutomaticPurchaseController->>AutomaticPurchaseController: Get selectedOffer (Subscription/OneTime) AutomaticPurchaseController->>AutomaticPurchaseController: Extract offerToken if needed AutomaticPurchaseController->>BillingClient: launchBillingFlow(offerToken) BillingClient-->>AutomaticPurchaseController: Purchase result AutomaticPurchaseController-->>TransactionManager: PurchaseResult alt Purchase Successful TransactionManager->>PaywallMessageHandler: TransactionComplete event alt shouldDismiss == true TransactionManager->>PaywallView: Dismiss paywall else shouldDismiss == false Note over PaywallView: Paywall remains open for post-purchase actions end end Note over PaywallView,WebView: Paywall State Capture on Dismiss User->>PaywallView: Close/Dismiss Paywall PaywallView->>PaywallMessageHandler: getState() PaywallMessageHandler->>WebView: Evaluate "window.app.getAllState()" WebView-->>PaywallMessageHandler: State JSON PaywallMessageHandler->>PaywallMessageHandler: Parse and convert state PaywallMessageHandler-->>PaywallView: Map<String, Any> PaywallView->>PaywallView: SetPaywallState(state) PaywallView->>PaywallView: Dismiss with state captured