-
Notifications
You must be signed in to change notification settings - Fork 3
feat(flutter): update for 2.4.12 #171
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
137 changes: 137 additions & 0 deletions
137
content/docs/flutter/sdk-reference/RedemptionResult.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| --- | ||
| title: "RedemptionResult" | ||
| description: "Result types returned when the Flutter SDK redeems a web checkout link." | ||
| --- | ||
|
|
||
| ## Purpose | ||
|
|
||
| Represents the result passed to [`didRedeemLink()`](/flutter/sdk-reference/SuperwallDelegate) after the SDK handles a web checkout redemption link. | ||
|
|
||
| ## Signature | ||
|
|
||
| ```dart | ||
| sealed class RedemptionResult {} | ||
|
|
||
| class RedemptionResultSuccess extends RedemptionResult { | ||
| final String code; | ||
| final RedemptionInfo redemptionInfo; | ||
| } | ||
|
|
||
| class RedemptionResultError extends RedemptionResult { | ||
| final String code; | ||
| final ErrorInfo error; | ||
| } | ||
|
|
||
| class RedemptionResultExpiredCode extends RedemptionResult { | ||
| final String code; | ||
| final ExpiredCodeInfo info; | ||
| } | ||
|
|
||
| class RedemptionResultInvalidCode extends RedemptionResult { | ||
| final String code; | ||
| } | ||
|
|
||
| class RedemptionResultExpiredSubscription extends RedemptionResult { | ||
| final String code; | ||
| final RedemptionInfo redemptionInfo; | ||
| } | ||
| ``` | ||
|
|
||
| ## Types | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| RedemptionResultSuccess: { | ||
| type: "RedemptionResult", | ||
| description: "The redemption succeeded. Inspect `redemptionInfo` for purchaser, entitlement, ownership, and paywall details.", | ||
| }, | ||
| RedemptionResultError: { | ||
| type: "RedemptionResult", | ||
| description: "The SDK could not redeem the code. Inspect `error.message` for the failure reason.", | ||
| }, | ||
| RedemptionResultExpiredCode: { | ||
| type: "RedemptionResult", | ||
| description: "The redemption code expired. Inspect `info.resent` and `info.obfuscatedEmail` for email resend details.", | ||
| }, | ||
| RedemptionResultInvalidCode: { | ||
| type: "RedemptionResult", | ||
| description: "The redemption code was invalid.", | ||
| }, | ||
| RedemptionResultExpiredSubscription: { | ||
| type: "RedemptionResult", | ||
| description: "The subscription associated with the redemption code expired.", | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## Success Data | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| "RedemptionInfo.ownership": { | ||
| type: "Ownership", | ||
| description: "Whether the redeemed code belongs to an app user or device.", | ||
| required: true, | ||
| }, | ||
| "RedemptionInfo.purchaserInfo": { | ||
| type: "PurchaserInfo", | ||
| description: "Purchaser details, including store identifiers for Stripe, Paddle, or another store.", | ||
| required: true, | ||
| }, | ||
| "RedemptionInfo.paywallInfo": { | ||
| type: "RedemptionPaywallInfo?", | ||
| description: "Paywall, placement, variant, and experiment details for the redeemed purchase.", | ||
| }, | ||
| "RedemptionInfo.entitlements": { | ||
| type: "Set<Entitlement>", | ||
| description: "Entitlements granted by the redeemed purchase.", | ||
| required: true, | ||
| }, | ||
| "PurchaserInfo.appUserId": { | ||
| type: "String", | ||
| description: "The app user ID of the purchaser.", | ||
| required: true, | ||
| }, | ||
| "PurchaserInfo.email": { | ||
| type: "String?", | ||
| description: "The purchaser email address, when available.", | ||
| }, | ||
| "PurchaserInfo.storeIdentifiers": { | ||
| type: "StoreIdentifiers", | ||
| typeDescriptionLink: "/flutter/sdk-reference/StoreIdentifiers", | ||
| description: "Public store identifier details for the redeemed purchase.", | ||
| required: true, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## Usage | ||
|
|
||
| ```dart | ||
| void didRedeemLink(RedemptionResult result) { | ||
| switch (result) { | ||
| case RedemptionResultSuccess(redemptionInfo: final info): | ||
| final purchaser = info.purchaserInfo; | ||
| print('Redeemed for ${purchaser.appUserId}'); | ||
| break; | ||
| case RedemptionResultError(error: final error): | ||
| print('Redemption failed: ${error.message}'); | ||
| break; | ||
| case RedemptionResultExpiredCode(info: final info): | ||
| print('Code expired; resent email: ${info.resent}'); | ||
| break; | ||
| case RedemptionResultInvalidCode(): | ||
| print('Invalid code'); | ||
| break; | ||
| case RedemptionResultExpiredSubscription(): | ||
| print('Expired subscription'); | ||
| break; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Related | ||
|
|
||
| - [`StoreIdentifiers`](/flutter/sdk-reference/StoreIdentifiers) | ||
| - [`SuperwallDelegate`](/flutter/sdk-reference/SuperwallDelegate) | ||
| - [Post-Checkout Redirecting](/flutter/guides/web-checkout/post-checkout-redirecting) |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The 2.4.12 entry says
StoreTransactionandTransactionProductare now publicly exported, but this update only changes version markers andPaywallOptions; there are still no corresponding docs undercontent/docs/flutter/sdk-reference(repo search for those symbols in that directory returns no matches). This leaves new public API surface undocumented and makes the Flutter SDK reference incomplete for this release; please add reference pages (and navigation entries) for the newly exported types or document where they are intentionally covered.Useful? React with 👍 / 👎.