-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[in_app_purchase] add storefront in skpaymentqueuewrapper #5348
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
update changelog fix test version check
@@ -21,6 +21,8 @@ typedef void (^UpdatedDownloads)(NSArray<SKDownload *> *downloads); | |||
|
|||
@property(NS_NONATOMIC_IOSONLY, weak, nullable) id<SKPaymentQueueDelegate> delegate API_AVAILABLE( | |||
ios(13.0), macos(10.15), watchos(6.2)); | |||
@property(NS_NONATOMIC_IOSONLY, readonly, nullable) |
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.
Why would we only want this to be nonatomic
on iOS? Surely we don't have different threading semantics for macOS?
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 storefront property in SKPaymentQueue is nonatomic on iOS. I tried to keep it the sam way but yeah we don't need it. Will revert to nonatomic for all.
} | ||
result([FIAObjectTranslator getMapFromSKStorefront:storefront]); | ||
return; | ||
} else { |
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.
Nit: no need to wrap code after an early return in else
.
@@ -139,6 +141,22 @@ - (void)getPendingTransactions:(FlutterResult)result { | |||
result(transactionMaps); | |||
} | |||
|
|||
- (void)getStorefront:(FlutterResult)result { | |||
if (@available(iOS 13.0, *)) { |
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.
We should include macOS 10.15+ here too.
result([FIAObjectTranslator getMapFromSKStorefront:storefront]); | ||
return; | ||
} else { | ||
NSLog(@"storefront is not avaialbe in iOS below 13.0."); |
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.
And this should mention both iOS and macOS.
@@ -419,6 +419,71 @@ - (void)testGetPendingTransactions { | |||
XCTAssertEqualObjects(resultArray, @[ transactionMap ]); | |||
} | |||
|
|||
- (void)testPaymentQueueStorefront { | |||
if (@available(iOS 13, *)) { |
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.
Or macOS 10.15
...p_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart
Outdated
Show resolved
Hide resolved
@stuartmorgan Updated as per your comments. PTAL! |
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.
LGTM with nits.
@@ -419,6 +419,71 @@ - (void)testGetPendingTransactions { | |||
XCTAssertEqualObjects(resultArray, @[ transactionMap ]); | |||
} | |||
|
|||
- (void)testPaymentQueueStorefront { | |||
if (@available(iOS 13, macOS 10.15, *)) { | |||
{ |
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.
Nit: These should be two separate test methods, rather than sub-blocks of the same test. Unit tests should each test as few things as is feasible.
@@ -41,6 +41,17 @@ class SKPaymentQueueWrapper { | |||
SKPaymentQueueDelegateWrapper? _paymentQueueDelegate; | |||
SKTransactionObserverWrapper? _observer; | |||
|
|||
/// Calls [`[SKPaymentQueue storefront]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/3182430-storefront?language=objc) |
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.
This is missing a period.
@@ -41,6 +41,17 @@ class SKPaymentQueueWrapper { | |||
SKPaymentQueueDelegateWrapper? _paymentQueueDelegate; | |||
SKTransactionObserverWrapper? _observer; | |||
|
|||
/// Calls [`[SKPaymentQueue storefront]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/3182430-storefront?language=objc) | |||
/// Returns `null` if the user's device is below iOS 13.0 or macOS 10.15. |
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.
And a blank comment line before this one, per Effective Dart.
auto label is removed for flutter/packages/5348, due to - The status or check suite Linux repo_checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@0cd2378...07b4b29 2023-11-16 kevmoo@users.noreply.github.com [script] use dart:io support for forwarding stdout/stderr (flutter/packages#5410) 2023-11-15 engine-flutter-autoroll@skia.org Manual roll Flutter (stable) from d211f42 to db7ef5b (1539 revisions) (flutter/packages#5409) 2023-11-15 ychris@google.com [in_app_purchase] add storefront in skpaymentqueuewrapper (flutter/packages#5348) 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,rmistry@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
Add
Future<SKStorefrontWrapper?> storefront()
method in SKPaymentQueue wrapperfixes flutter/flutter#137560
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.