Added InAppBilling.VerifyPreviousPurchaseAsync() #210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So I was thinking, what should I do if user purchases the product in the store but the verification on our server fails. I was looking for a way to call the verification on this purchase again, but did not find a solution.
Calling
InAppBillingImplementation.GetPurchasesAsync()
with verification will try to verify all the previous purchases, which is not what I want - it will fail on the server because it had been verified before and also the server request will be pointless for those already verified purchases. And if user just tries to purchase the product again, it will fail withPurchaseError.AlreadyOwned
and the verification will not be performed, right?I've been thinking about many ways how this could be implemented, but I think this one is the easiest. Tell me what you think, it's my first PR here.
Changes Proposed in this pull request:
BaseInAppBilling.VerifyPreviousPurchaseAsync()
method to support verifying a single previous purchase, internally usingGetPurchasesAsync()
method with verification limited to the specified productInAppBillingImplementation.GetPurchasesAsync()
methods toprotected
to support the additional parameter and moved the originalpublic
method toBaseInAppBilling