Skip to content

[in_app_purchase_storekit] Remove unneeded platform annotations #7914

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 9 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.19+1

* Removes unneeded platform availability annotations.

## 0.3.19

* Adds StoreKit2 Transaction expiration date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ NS_ASSUME_NONNULL_BEGIN

/// A list of SKPaymentTransactions, which each represents a single transaction
@property(nonatomic, strong) NSArray<SKPaymentTransaction *> *transactions API_AVAILABLE(
ios(3.0), macos(10.7), watchos(6.2), visionos(1.0));
ios(3.0), macos(10.7), watchos(6.2));

/// An object that provides information needed to complete transactions.
@property(nonatomic, weak, nullable) id<SKPaymentQueueDelegate> delegate API_AVAILABLE(
ios(13.0), macos(10.15), watchos(6.2), visionos(1.0));
ios(13.0), macos(10.15), watchos(6.2));

/// Remove a finished (i.e. failed or completed) transaction from the queue. Attempting to finish a
/// purchasing transaction will throw an exception.
Expand All @@ -40,19 +40,17 @@ NS_ASSUME_NONNULL_BEGIN
/// Will add completed transactions for the current user back to the queue to be re-completed. This
/// version requires an identifier to the user's account.
- (void)restoreCompletedTransactionsWithApplicationUsername:(nullable NSString *)username
API_AVAILABLE(ios(7.0), macos(10.9), watchos(6.2), visionos(1.0));
API_AVAILABLE(ios(7.0), macos(10.9), watchos(6.2));

/// Call this method to have StoreKit present a sheet enabling the user to redeem codes provided by
/// your app. Only for iOS.
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0), visionos(1.0))
API_UNAVAILABLE(tvos, macos, watchos);
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0))API_UNAVAILABLE(tvos, macos, watchos);

/// If StoreKit has called your SKPaymentQueueDelegate's "paymentQueueShouldShowPriceConsent:"
/// method and you returned NO, you can use this method to show the price consent UI at a later time
/// that is more appropriate for your app. If there is no pending price consent, this method will do
/// nothing.
- (void)showPriceConsentIfNeeded API_AVAILABLE(ios(13.4), visionos(1.0))
API_UNAVAILABLE(tvos, macos, watchos);
- (void)showPriceConsentIfNeeded API_AVAILABLE(ios(13.4))API_UNAVAILABLE(tvos, macos, watchos);
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g Oct 24, 2024

Choose a reason for hiding this comment

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

In other places you removed watchos; we should either only remove visionos everywhere, since that's the problem, or we should remove watchos and tvos everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thats fair. let me put them back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i see you edited your comment. Do you mean I should also remove watchos and tvos from API_UNAVAILABLE?

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g Oct 26, 2024

Choose a reason for hiding this comment

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

Putting them back is fine; I edited my comment because I meant to say that we should be consistent one way or the other—either list watchos and tvos everywhere, or don't list them anywhere—but what I actually wrote was the same option two different phrased ways.


@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ - (void)restoreCompletedTransactionsWithApplicationUsername:(nullable NSString *
[self.queue restoreCompletedTransactionsWithApplicationUsername:username];
}

- (id<SKPaymentQueueDelegate>)delegate API_AVAILABLE(ios(13.0), macos(10.15), watchos(6.2),
visionos(1.0)) {
- (id<SKPaymentQueueDelegate>)delegate API_AVAILABLE(ios(13.0), macos(10.15), watchos(6.2)) {
return self.queue.delegate;
}

- (NSArray<SKPaymentTransaction *> *)transactions API_AVAILABLE(ios(3.0), macos(10.7), watchos(6.2),
visionos(1.0)) {
- (NSArray<SKPaymentTransaction *> *)transactions API_AVAILABLE(ios(3.0), macos(10.7),
watchos(6.2)) {
return self.queue.transactions;
}

Expand All @@ -58,15 +57,13 @@ - (SKStorefront *)storefront API_AVAILABLE(ios(13.0)) {
}

#if TARGET_OS_IOS
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0), visionos(1.0))
API_UNAVAILABLE(tvos, macos, watchos) {
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0))API_UNAVAILABLE(tvos, macos, watchos) {
[self.queue presentCodeRedemptionSheet];
}
#endif

#if TARGET_OS_IOS
- (void)showPriceConsentIfNeeded API_AVAILABLE(ios(13.4), visionos(1.0))
API_UNAVAILABLE(tvos, macos, watchos) {
- (void)showPriceConsentIfNeeded API_AVAILABLE(ios(13.4))API_UNAVAILABLE(tvos, macos, watchos) {
[self.queue showPriceConsentIfNeeded];
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ API_AVAILABLE(ios(13.0), macos(10.15))
@property(nonatomic, strong, nullable) id<SKPaymentTransactionObserver> observer;
@property(nonatomic, strong, readwrite) SKStorefront *storefront API_AVAILABLE(ios(13.0));
@property(nonatomic, strong, readwrite) NSArray<SKPaymentTransaction *> *transactions API_AVAILABLE(
ios(3.0), macos(10.7), watchos(6.2), visionos(1.0));
ios(3.0), macos(10.7), watchos(6.2));

// Test Properties
@property(nonatomic, assign)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.19
version: 0.3.19+1

environment:
sdk: ^3.3.0
Expand Down