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

Add SubscriptionType to differentiate between auto-renewable and non-renewing subscriptions. #161

Merged
merged 1 commit into from Mar 9, 2017

Conversation

bizz84
Copy link
Owner

@bizz84 bizz84 commented Mar 8, 2017

For auto-renewable, receipt["latest_receipt_info"] is used.
For non-renewing, receipt["receipt"]?["in_app"] is used.

This fixes a bug where receipt verification fails for non-renewing subscriptions (which were previously using "latest_receipt_info".

…d non-renewing subscriptions.

For auto-renewable, receipt["latest_receipt_info"] is used.
For non-renewing, receipt["receipt"]?["in_app"] is used.
@bizz84 bizz84 self-assigned this Mar 8, 2017
@bryanbartow
Copy link
Contributor

Pushing new build using this branch to my test users shortly. I'll report results back.

@griddle
Copy link

griddle commented Mar 8, 2017

thanks @bizz84

I've never worked with StoreKit until a couple days ago so take this with a grain of salt, but one thing I've noticed is that for auto-renewing subscriptions in a Subscription Group, if the user switches between groups (ie: upgrades or downgrades), there's no way to know that. This code will return that they're on both subscriptions and neither are expired.

I've read a few blogs that solve this by doing:

let currentReceipt = receipts["latest_receipt_info"].last

I'm not sure if that will work if you have more than one Subscription Group though.

I'm still learning and I will submit a PR if I can provide a helpful update on this problem.

@bizz84
Copy link
Owner Author

bizz84 commented Mar 8, 2017

@griddle seems like this page explains Subscription Groups in detail: https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/CreatingInAppPurchaseProducts.html

If you found more documentation/blogs with practical notes about how to make it work, could you share links here?

If we can understand how this is meant to work, then it can be implemented accordingly.

@bryanbartow
Copy link
Contributor

Beta testers all report the build using this PR is working as expected. Thanks for the fix @bizz84.

@bizz84 bizz84 merged commit d939e82 into develop Mar 9, 2017
@bizz84 bizz84 deleted the feature/fix-non-renewing-subscription-verification branch March 14, 2017 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants