-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] add Storefront.countryCode() and AppStore.sync() #8900
base: main
Are you sure you want to change the base?
Conversation
let error = PigeonError( | ||
code: "storekit2_failed_to_fetch_country_code", | ||
message: "Storekit has failed to fetch the country code.", | ||
details: "Storekit has failed to fetch the country code.") |
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.
is details
optional? can we pass nil?
details: "Storekit has failed to fetch the country code.") | ||
return completion(.failure(error)) | ||
} | ||
return completion(.success(currentStorefront.countryCode)) |
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 a weird way to write it - it's returning whatever to be returned from completion
closure, which is Void
.
do { | ||
try await AppStore.sync() | ||
} catch { | ||
fatalError("Failed to sync to the AppStore: \(error)") |
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.
shouldn't it complete with error rather than crash?
Fixes flutter/flutter#159631 and fixes flutter/flutter#165659
Adds iap support for accessing store front country code and manual transaction syncing.
Pre-Review Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or I have commented below to indicate which [version change exemption] this PR falls under[^1].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style], or I have commented below to indicate which [CHANGELOG exemption] this PR falls under[^1].///
).