Skip to content

Conversation

@kaiquegazola
Copy link
Contributor

@kaiquegazola kaiquegazola commented Jan 22, 2025

Adds StoreKit2 support for:

  • Win Back Offers (requires Xcode 16 or later)
    • New isWinBackOfferEligible method for eligibility checks
  • Promotional Offers
  • Fixes introductory pricing handling in promotional offers list
  • Fixes appAccountToken handling for StoreKit2 purchases

Fixes:
flutter/flutter#161393
flutter/flutter#160826

Pre-launch Checklist

@LouiseHsu
Copy link
Contributor

Hey just letting you know Ive looked at your PR, and it looks really good! I've checked out your branch and it seems to work well locally. However our tests are failing to compile because currently they're running on ios 17.0. I'm taking a look to see if theres a way around this, but if you want to try building your branch on Xcode 15 or lower that would be really helpful too!

@kaiquegazola
Copy link
Contributor Author

Thanks for for testing it locally

It seems we’re currently blocked by flutter/flutter#148870. Also, I think we should add a CHANGELOG warning regarding this Xcode requirement.

Maybe an #if compiler directive could help here, but I haven’t tested it yet, so I’m not sure if it actually works. Let me know what you think

…se-storekit2-win-back-offers

# Conflicts:
#	packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md
@kaiquegazola kaiquegazola marked this pull request as draft January 30, 2025 19:37
@kaiquegazola kaiquegazola marked this pull request as ready for review January 31, 2025 03:14
@kaiquegazola
Copy link
Contributor Author

Hi @LouiseHsu, when you have a moment, could you please take a look at this PR? Thanks

@stuartmorgan-g stuartmorgan-g added the triage-ios Should be looked at in iOS triage label Mar 6, 2025
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation! LGTM (with nits and a few more questions).


var nonceAsUUID: UUID {
guard let uuid = UUID(uuidString: nonce) else {
fatalError("Invalid UUID format for nonce: \(nonce)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't know it was an existing pattern. In that case if there's a better way to handle these errors more gracefully we can refactor those later.

Future<bool> buyNonConsumable({required PurchaseParam purchaseParam}) async {
if (_useStoreKit2) {
final SK2ProductPurchaseOptions options = SK2ProductPurchaseOptions(
late SK2ProductPurchaseOptions options;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This doesnt seem to have been addressed).

final SK2ProductPurchaseOptions options = SK2ProductPurchaseOptions(
late SK2ProductPurchaseOptions options;

if (purchaseParam is Sk2PurchaseParam) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed explanation! That sounds good to me. From reading the docs it seems that store_kit_2_wrappers and store_kit_wrappers are supposed to reflect the store kit 2 and store kit 1 API and the platform agnostic abstraction happens in in-app-purchase and in-app-purchase-storekit, I believe that's inline with what you said.

So with this patch developers would be able to use win back offers, but only with in_app_purchase_storekit / store_kit_2_wrappers?

@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 2, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 2, 2025

autosubmit label was removed for flutter/packages/8474, because This PR has not met approval requirements for merging. Changes were requested by {stuartmorgan-g}, please make the needed changes and resubmit this PR.
The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a flutter-hacker before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 2, 2025
@LouiseHsu
Copy link
Contributor

@stuartmorgan-g do you have any outstanding concerns about this PR?

@stuartmorgan-g
Copy link
Collaborator

Sorry, I didn't realize I still had a blocking request on this.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 2, 2025
@auto-submit auto-submit bot merged commit a06b67b into flutter:main Jun 2, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 3, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jun 3, 2025
flutter/packages@4463066...1765c95

2025-06-03 [email protected] [video_player] Platform view
support (flutter/packages#8810)
2025-06-02 [email protected] [in_app_purchase_storekit] Add
support to win back offers / promotional offers (flutter/packages#8474)
2025-06-02 [email protected] [two_dimensional_scrollables]
Enable multi-cell/single-cell text selection in Simple Table example
(flutter/packages#8189)
2025-05-30 [email protected] [all_packages]
Bump `compileSdk` version to 35 (flutter/packages#9168)
2025-05-30 [email protected] Roll Flutter (stable) from
be698c4 to b25305a (11 revisions) (flutter/packages#9342)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@kaiquegazola kaiquegazola deleted the feature/in-app-purchase-storekit2-win-back-offers branch June 3, 2025 17:36
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…al offers (flutter#8474)

**Adds StoreKit2 support for**:  
 - **Win Back Offers** (requires Xcode 16 or later)
    - New `isWinBackOfferEligible` method for eligibility checks
 - **Promotional Offers**
- Fixes introductory pricing handling in promotional offers list
- Fixes  `appAccountToken` handling for StoreKit2 purchases

Fixes:
flutter/flutter#161393
flutter/flutter#160826
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
…al offers (flutter#8474)

**Adds StoreKit2 support for**:  
 - **Win Back Offers** (requires Xcode 16 or later)
    - New `isWinBackOfferEligible` method for eligibility checks
 - **Promotional Offers**
- Fixes introductory pricing handling in promotional offers list
- Fixes  `appAccountToken` handling for StoreKit2 purchases

Fixes:
flutter/flutter#161393
flutter/flutter#160826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: in_app_purchase platform-ios platform-macos triage-ios Should be looked at in iOS triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants