-
Notifications
You must be signed in to change notification settings - Fork 316
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
PurchaseOrchestrator
: fix incorrect InitiationSource
for SK1 queue transactions
#2430
PurchaseOrchestrator
: fix incorrect InitiationSource
for SK1 queue transactions
#2430
Conversation
a8dfbdd
to
fc064d5
Compare
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!
@aboedo does this look good to you? |
private func initiationSource( | ||
for productIdentifier: String, | ||
restored: Bool | ||
) -> ProductRequestData.InitiationSource { | ||
// Having a purchase completed callback implies that the transation comes from an explicit call | ||
// to `purchase()` instead of a StoreKit transaction notification. |
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.
I think this works.
I got quite confused at first, since that restore isn't coming from us, and we do offer the ability to attach a completion block to restores when they get initiated through our SDK.
But restores that are coming from us won't actually go through this flow in the first place since they don't issue transactions in the queue. Instead, for our restores we just refresh the receipt and send it.
Maybe we can document that behavior more in detail?
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.
…e transactions (#2430) All StoreKit 1 transactions were being sent with `InitiationSource.purchased`. #1957 introduced this, but it was only set correctly for SK2. The consequence of this is that users might see "invalid receipt" errors when posting receipts due to updated transactions from the queue, which can only happen for `InitiationSource.purchased`.
All StoreKit 1 transactions were being sent with
InitiationSource.purchased
.#1957 introduced this, but it was only set correctly for SK2.
The consequence of this is that users might see "invalid receipt" errors when posting receipts due to updated transactions from the queue, which can only happen for
InitiationSource.purchased
.