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

Checking for an active auto-renewable subscription returns incorrect results #230

Open
BigZaphod opened this issue Aug 15, 2019 · 2 comments

Comments

@BigZaphod
Copy link

BigZaphod commented Aug 15, 2019

There's a very nasty logical flaw in RMAppReceipt's -containsActiveAutoRenewableSubscriptionOfProductIdentifier:forDate: method.

This method first sorts through the receipt records looking for the newest one (using the expiration date) and then only checks that single record against the given date. One major problem with this is that the real-life production App Store receipts sometimes have renewal records from the future in them. This means if you use the current date (or a date from a few hours ago, or yesterday, or whatever) as your reference date, this method will first find the newest possible record - which is sometimes one that has already been generated for the NEXT billing period. It will then check if the date comes after that record's start date - which of course it does not. It then erroneously returns NO.

I posted a long thread on twitter about my adventures tracking this down here: https://twitter.com/BigZaphod/status/1162094913552625665

@hash3r
Copy link

hash3r commented Nov 26, 2019

@BigZaphod hey, I am not sure I got your point.
could you elaborate a bit more?
how do you check it now?
not t in a range of date but only expiration date?

@Smart9110
Copy link

Smart9110 commented Nov 26, 2019 via email

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

No branches or pull requests

3 participants