Skip to content
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

Difference between refreshReceipt and restorePurchases #207

Closed
ioanalexme opened this issue May 12, 2017 · 2 comments
Closed

Difference between refreshReceipt and restorePurchases #207

ioanalexme opened this issue May 12, 2017 · 2 comments
Labels
answered Questions which have accepted answers. type: question

Comments

@ioanalexme
Copy link

ioanalexme commented May 12, 2017

Hello,

I'm trying to understand the difference between the "SwiftyStoreKit.refreshReceipt" and "SwiftyStoreKit.restorePurchases" calls, as in result to the receipt in the bundle.

"SwiftyStoreKit.restorePurchases" is also updating the receipt in the bundle ?

Thank you

@ioanalexme ioanalexme changed the title Difference between refreshReceipt and verifyReceipt Difference between refreshReceipt and restorePurchases May 12, 2017
@bizz84
Copy link
Owner

bizz84 commented May 15, 2017

@AlexDenk I think this guide from Apple may help you:

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9

Quoting:

In most cases, all your app needs to do is refresh its receipt and deliver the products in its receipt. The refreshed receipt contains a record of the user’s purchases in this app, on this device or any other device.

This is what happens when you call refreshReceipt().

Restoring completed transactions creates a new transaction for every completed transaction the user made, essentially replaying history for your transaction queue observer.

This is what happens when you call restorePurchases().

As SwiftyStoreKit doesn't (yet) support local receipt validation, the only way to read the receipt is to call refreshReceipt(), which always updates the receipt in the bundle.

Does this answer your question?

@bizz84 bizz84 added the answered Questions which have accepted answers. label May 15, 2017
@ioanalexme
Copy link
Author

Excellent, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Questions which have accepted answers. type: question
Projects
None yet
Development

No branches or pull requests

2 participants