You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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?
________________________________
From: hash3r <[email protected]>
Sent: Tuesday, November 26, 2019 10:10 AM
To: robotmedia/RMStore <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [robotmedia/RMStore] Checking for an active auto-renewable subscription returns incorrect results (#230)
@BigZaphod<https://github.com/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?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#230?email_source=notifications&email_token=AEE4PVAKHKUN46SXHKK6VLTQVTY3FA5CNFSM4IMBWL72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFFO66I#issuecomment-558559097>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEE4PVBG7K7NKM6NFPQRIILQVTY3FANCNFSM4IMBWL7Q>.
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
The text was updated successfully, but these errors were encountered: