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

Fixing subscription verifying in receipt #109

Closed
wants to merge 1 commit into from
Closed

Fixing subscription verifying in receipt #109

wants to merge 1 commit into from

Conversation

grishamsc
Copy link

Verifying subscription check ["latest_receipt_info"] section instead
["receipt"]["in_app"]

//
I do pull request for first time, hope did all correct.

I think you should check latest_receipt_info section instead in_app, because this sections refresh every time you do receipt verification on iTunes server. in_app section doesn’t refresh guaranteed. 100% it refresh only if u perform receipt refresh.

Verifying subscription check ["latest_receipt_info"] section instead
["receipt"]["in_app"]
@bizz84
Copy link
Owner

bizz84 commented Jan 15, 2017

@grishamsc sorry for the very late reply.

Is there some documentation recommending to use receipt["latest_receipt_info"] rather than ["receipt"]["in_app"]?

@grishamsc
Copy link
Author

bizz84
hm, i didn't looked in documentation, but I notice this by a lot of experiments.
["receipt"]["in_app"] may refresh or may not refresh without refreshing receipt on device. Often it doesn't occur. If you validate subscription on server, not on device, you need every time refresh receipt on device and load it to server.
receipt["latest_receipt_info"] refresh and give actual information every time you send receipt to iTunes server for verification.

I use code, which I include in pull request in my application and all work fine)

I think I should look up this information in documentation and show it to you to be pretty sure.

@nlogioco
Copy link

nlogioco commented Jan 20, 2017

@bizz84 @grishamsc
I didn't realize this pull request existed.

I created an issue ticket: #129

This link explains why to use "latest_receipt_info"

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

The above link explains why.
From link above:

latest_receipt_info : Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions. The JSON representation of the receipt for the most recent renewal.

@bizz84
Copy link
Owner

bizz84 commented Jan 29, 2017

@nlogioco @grishamsc I agree, it seems more appropriate to use latest_recepit_info.

I have just merged a major change to SwiftyStoreKit and should have some time to look into this properly this week.

@bizz84
Copy link
Owner

bizz84 commented Feb 5, 2017

Verified the documentation and ran some tests on the sandbox. I made a new PR for this: #134

@bizz84
Copy link
Owner

bizz84 commented Feb 5, 2017

Closing as this is now fixed in version 0.7.1: https://github.com/bizz84/SwiftyStoreKit/releases

@bizz84 bizz84 closed this Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants