Skip to content

[in_app_purchase_storekit] Add support for purchase and transactions #7574 #7812

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 55 commits into from
Oct 17, 2024

Conversation

LouiseHsu
Copy link
Contributor

@LouiseHsu LouiseHsu commented Oct 7, 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

Pre-launch Checklist

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

@LouiseHsu
Copy link
Contributor Author

Relands #7574

For future reference, what were the changes to resolve the issue that led to the revert?

Oops, I accidentally updated your comment when I meant to quote it.

Even thought storekittest is technically a mac 11 framework, the bulk of the testing features, such simulating network errors and things like that are mac 14 only. The presubmits passed because it ran on a Mac 14 bot, but the post submit failed because it ran on a Mac 13 bot. :( I've removed the reference to the tests in the mac project in the mean time, since I'm not sure when we'll fully upgrade our fleet. The tests are shared between mac and ios, so the code coverage should be the same.

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

stuartmorgan-g commented Oct 17, 2024

This failed stable post-submit again: https://github.com/flutter/packages/runs/31667628631

2024-10-17 03:21:48.496039-0700 example[4996:54001] [loading] Error loading /Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Build/Products/Debug/example.app/Contents/PlugIns/RunnerTests.xctest/Contents/MacOS/RunnerTests (185):  dlopen(/Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Build/Products/Debug/example.app/Contents/PlugIns/RunnerTests.xctest/Contents/MacOS/RunnerTests, 0x0109): Symbol not found: _$s8StoreKit10parseErrorys0D0_psAC_pF
  Referenced from: <83F64577-ACD3-37DA-BE65-D2B3EFEAF66A> /Volumes/Work/s/w/ir/cache/osx_sdk/xcode_15a240d/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/StoreKitTest.framework/Versions/A/StoreKitTest
  Expected in:     <B587D69F-36D8-3163-B1C2-C93FB07648A8> /System/Library/Frameworks/StoreKit.framework/Versions/A/StoreKit
2024-10-17 03:21:48.496159-0700 example[4996:54001] [Default] The bundle “RunnerTests” couldn’t be loaded. Try reinstalling the bundle.
2024-10-17 03:21:48.496177-0700 example[4996:54001] [Default] (dlopen(/Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Build/Products/Debug/example.app/Contents/PlugIns/RunnerTests.xctest/Contents/MacOS/RunnerTests, 0x0109): Symbol not found: _$s8StoreKit10parseErrorys0D0_psAC_pF
  Referenced from: <83F64577-ACD3-37DA-BE65-D2B3EFEAF66A> /Volumes/Work/s/w/ir/cache/osx_sdk/xcode_15a240d/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/StoreKitTest.framework/Versions/A/StoreKitTest
  Expected in:     <B587D69F-36D8-3163-B1C2-C93FB07648A8> /System/Library/Frameworks/StoreKit.framework/Versions/A/StoreKit)
2024-10-17 03:21:48.497216-0700 example[4996:54389] [client] No error handler for XPC error: Connection invalid


*** If you believe this error represents a bug, please attach the result bundle at /Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Logs/Test/Run-Runner-2024.10.17_03-21-28--0700.xcresult

2024-10-17 03:21:51.278 xcodebuild[4770:53111] [MT] IDETestOperationsObserverDebug: 5.931 elapsed -- Testing started completed.
2024-10-17 03:21:51.278 xcodebuild[4770:53111] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2024-10-17 03:21:51.278 xcodebuild[4770:53111] [MT] IDETestOperationsObserverDebug: 5.931 sec, +5.931 sec -- end

Test session results, code coverage, and logs:
	/Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Logs/Test/Run-Runner-2024.10.17_03-21-28--0700.xcresult

Testing failed:
	example (4996) encountered an error (Failed to load the test bundle. (Underlying Error: The bundle “RunnerTests” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Users/chrome-bot/Library/Developer/Xcode/DerivedData/Runner-cqhwqvjiontyvddtpbfbwdhoqskw/Build/Products/Debug/example.app/Contents/PlugIns/RunnerTests.xctest/Contents/MacOS/RunnerTests, 0x0109): Symbol not found: _$s8StoreKit10parseErrorys0D0_psAC_pF
  Referenced from: <83F64577-ACD3-37DA-BE65-D2B3EFEAF66A> /Volumes/Work/s/w/ir/cache/osx_sdk/xcode_15a240d/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/StoreKitTest.framework/Versions/A/StoreKitTest
  Expected in:     <B587D69F-36D8-3163-B1C2-C93FB07648A8> /System/Library/Frameworks/StoreKit.framework/Versions/A/StoreKit))

** TEST FAILED **

@stuartmorgan-g
Copy link
Contributor

Even thought storekittest is technically a mac 11 framework, the bulk of the testing features, such simulating network errors and things like that are mac 14 only. The presubmits passed because it ran on a Mac 14 bot, but the post submit failed because it ran on a Mac 13 bot. :(

I think that if in your next version of this you temporarily, in your PR, change the .ci.yaml to only allow Mac 13 hosts, you might be able to get presubmit testing to make sure everything is good. (I'm not 100% sure that change takes effect in presubmit though.)

@LouiseHsu
Copy link
Contributor Author

Even thought storekittest is technically a mac 11 framework, the bulk of the testing features, such simulating network errors and things like that are mac 14 only. The presubmits passed because it ran on a Mac 14 bot, but the post submit failed because it ran on a Mac 13 bot. :(

I think that if in your next version of this you temporarily, in your PR, change the .ci.yaml to only allow Mac 13 hosts, you might be able to get presubmit testing to make sure everything is good. (I'm not 100% sure that change takes effect in presubmit though.)

Oh, thats a good idea. Im really struggling with testing this properly cuz I have to keep restarting and trying to get specific bots.

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

2024-10-17 50643541+Mairramer@users.noreply.github.com [two_dimensional_scrollables] Fixes TreeViewNode collapsing not working (flutter/packages#7474)
2024-10-17 stuartmorgan@google.com Revert "[in_app_purchase_storekit] Add support for purchase and transactions #7574" (flutter/packages#7886)
2024-10-17 109111084+yaakovschectman@users.noreply.github.com [camera_android] Mark `description` in `sendCameraErrorEvent` as `@NonNull` (flutter/packages#7877)
2024-10-17 chris@bracken.jp [image_picker_web] Loosen mime dep to >=1.0.4 <3.0.0 (flutter/packages#7879)
2024-10-17 52160996+FMorschel@users.noreply.github.com Removing unnecessary parenthesis (flutter/packages#7881)
2024-10-17 louisehsu@google.com [in_app_purchase_storekit] Add support for purchase and transactions #7574 (flutter/packages#7812)

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