-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[in_app_purchase] Fix app exceptions caused by missing App Store receipt #2862
Conversation
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.
Thanks for the PR and tests!
packages/in_app_purchase/lib/src/store_kit_wrappers/sk_receipt_manager.dart
Show resolved
Hide resolved
} catch (_) { | ||
rethrow; | ||
} |
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 the catch and rethrow here? I think this behaves identically to how just returning the await would, since it's rethrowing everything.
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.
Reverted.
@@ -1,3 +1,6 @@ | |||
## 0.3.4+2 |
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.
new line after the version
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.
Done
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 diff seems odd, CHANGELOG probably needs to be re-based
packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart
Show resolved
Hide resolved
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.
Let's rebase it and land this :) @LHLL
@@ -1,3 +1,6 @@ | |||
## 0.3.4+2 |
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 diff seems odd, CHANGELOG probably needs to be re-based
NSData *receipt = [self getReceiptData:receiptURL]; | ||
NSError *err; | ||
NSData *receipt = [self getReceiptData:receiptURL error:&err]; | ||
if (err) { |
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 we also add an xctest to test this?
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.
friendly ping @LHLL
@mvanbeusekom Perhaps you could adopt this PR and get it rebased and xctested? |
I tried rebasing and cherry picking, but this PR does not go well with our federated architecture changes. I'll just copy paste the changes in a new branch Edit: @stuartmorgan I added all changes of this PR in 1 commit in #4096, so this outdated PR can be closed if you agree nothing is missing. |
Rebase of flutter/pull/2862 Co-authored-by: LHLL <yijiexu@google.com>
Closing in favor of the new PR. |
Description
Missing App Store receipt can happen for different scenarios, thus shouldn't trigger an exception.
Related Issues
flutter/flutter#43957
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?