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

Overly constrained date gating in active autorenewal check results in false negatives #199

Open
lzell opened this issue Nov 11, 2016 · 0 comments

Comments

@lzell
Copy link

lzell commented Nov 11, 2016

Greetings,

The date constraint found here:
https://github.com/robotmedia/RMStore/blob/master/RMStore/Optional/RMAppReceipt.m#L389
outputs false if the purchase date of a renewable IAP lies after the date we are checking against. This seems like a reasonable assumption to make, but per the guidance here (which is good advice because I have seen this lapse in production):

@warning Auto-renewable subscription lapses are possible. If you are checking against the current date, you might want to deduct some time as tolerance.

we are subtracting a day from the current time and passing the resulting date into containsActiveAutoRenewableSubscription. The result is that the check is returning false on what should be an active subscription if the check is performed within 1 day (or whatever grace period is set) of purchasing.

I can submit a PR easily to fix this by dropping the first condition of the date comparison, but want to make sure there are no adverse effects that I am not considering. My proposed fix is to change this:

return [self.purchaseDate compare:date] != NSOrderedDescending && [date compare:self.subscriptionExpirationDate] != NSOrderedDescending;
to this:

return [date compare:self.subscriptionExpirationDate] != NSOrderedDescending;

Thanks for the hard work on RMStore!

Lou

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

1 participant