-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #7574
base: main
Are you sure you want to change the base?
Conversation
@@ -27,6 +27,10 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { | |||
// This property is optional, as it requires self to exist to be initialized. | |||
public var paymentQueueHandler: FLTPaymentQueueHandlerProtocol? | |||
|
|||
// This should be an Task, but Task is on available >= iOS 13 | |||
var updateListenerTask: Any? |
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.
can you try out that getter trick discussed yesterday?
packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.swift
Outdated
Show resolved
Hide resolved
..._app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift
Outdated
Show resolved
Hide resolved
..._app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift
Outdated
Show resolved
Hide resolved
} | ||
case .pending: | ||
completion( | ||
.failure( |
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.
reduce indentation by combining these
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 formatter uncombines these
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.
strange. it's clearly less than 100 characters. how's your code like before the formatter?
@MainActor in | ||
do { | ||
let transactionsMsgs = await rawTransactions().map { | ||
$0.convertToPigeon() |
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: use keypath
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.
"Keypath can’t be used on instance methods"
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.
oh you are right
..._app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift
Outdated
Show resolved
Hide resolved
} | ||
|
||
/// Helper function to cast updateListenerTask to a task | ||
func getUpdateListenerTask() -> Task<(), Never> { |
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.
can you use a getter (rather than a function) in the class definition (rather than extension). And make updateListenerTask
private.
..._purchase/in_app_purchase_storekit/example/shared/RunnerTests/StoreKit2TranslatorTests.swift
Outdated
Show resolved
Hide resolved
@testable import in_app_purchase_storekit | ||
|
||
@available(iOS 15.0, macOS 12.0, *) | ||
class StoreKit2TranslatorTests: XCTestCase { |
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.
final class
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 after the nits
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
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, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.