Skip to content
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

[in_app_purchase_storekit] Add support for purchase and transactions #7887

Merged
merged 57 commits into from
Oct 17, 2024

Conversation

LouiseHsu
Copy link
Contributor

@LouiseHsu LouiseHsu commented Oct 17, 2024

This PR contains the preliminary implementations for handling purchases and transactions

Of note, as of StoreKit 2, the result of a call to a purchase will only return a Transaction when the purchase is successful. If the status of purchase is pending, or cancelled, nothing will be returned.

This is in contrast to StoreKit 1, where developers could check the state of a Transaction with TransactionState. This means that migrating to StoreKit 2 will require developers to update their handling of transactions accordingly.

Relands #7574

Part of flutter/flutter#116383

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@LouiseHsu LouiseHsu changed the title Iap add purchase [in_app_purchase_storekit] Add support for purchase and transactions Oct 17, 2024
@LouiseHsu
Copy link
Contributor Author

OKAY I have fixed it. The difference between this and the previous failures are that 1. Removed all references to StoreKitTest in the Mac projects, and 2. removed StoreKitTest as an added framework in Xcode:

Screenshot 2024-10-17 at 13 08 05

From this ^

Proof that it's successfully running on Mac 13 bots
https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Mac_arm64%20macos_platform_tests%20master%20-%20packages/557/overview
https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Mac_arm64%20macos_platform_tests%20master%20-%20packages/558/overview

@gaaclarke gaaclarke marked this pull request as ready for review October 17, 2024 21:03
Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

The changes since the last land ( b93dce2) sounds reasonable to me and likely eliminate the reason it was reverted, lgtm.

@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 17, 2024
@auto-submit auto-submit bot merged commit e19503e into flutter:main Oct 17, 2024
76 checks passed
@codingiran
Copy link

codingiran commented Oct 18, 2024

@LouiseHsu Could you provide a demo for migrating to StoreKit 2? I’m facing several points of confusion:

1.When a user cancels a purchase, purchaseStream in StoreKit 1 returns PurchaseStatus.canceled, but StoreKit 2 throws an exception instead.
2.StoreKit 2 doesn’t enter the PurchaseStatus.pending state, which is different from how StoreKit 1 handles this.
3.Your suggestion mentions that “StoreKit 2 will require developers to update their handling of transactions accordingly,” but I’m not sure how to properly handle transactions in StoreKit 2.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 18, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 18, 2024
flutter/packages@5582669...2a1c477

2024-10-18 109111084+yaakovschectman@users.noreply.github.com [camera_android] Convert Dart to native calls to use Pigeon (flutter/packages#7874)
2024-10-17 ftsui@google.com [url_launcher] Decode file URLs before passing it to ShellExecuteW (flutter/packages#7774)
2024-10-17 louisehsu@google.com [in_app_purchase_storekit] Add support for purchase and transactions (flutter/packages#7887)
2024-10-17 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Adds internal wrapper for iOS native `IMACompanionAd` (flutter/packages#7873)

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 flutter-ecosystem@google.com 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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants