MKStoreKit icon indicating copy to clipboard operation
MKStoreKit copied to clipboard

Wrong logic in Expire Date for subscriptions

Open kataliz opened this issue 10 years ago • 3 comments

In code (in method -paymentQueue...) if found your comments - // non-consumable or subscriptions // subscriptions will eventually contain the expiry date after the receipt is validated during the next run self.purchaseRecord[transaction.payment.productIdentifier] = [NSNull null];

ok. But when you validate receipt you write this: NSNumber *expiresDateMs = receiptDictionary[@"expires_date_ms"]; NSNumber *previouslyStoredExpiresDateMs = self.purchaseRecord[productIdentifier]; if (expiresDateMs && ![expiresDateMs isKindOfClass:[NSNull class]] && ![previouslyStoredExpiresDateMs isKindOfClass:[NSNull class]]) { if ([expiresDateMs doubleValue] > [previouslyStoredExpiresDateMs doubleValue]) { self.purchaseRecord[productIdentifier] = expiresDateMs; purchaseRecordDirty = YES; } }

There is only one place where you set in purchaseRecord expires date. But how could old value be not null? this is the bug ?

kataliz avatar Jun 05 '15 19:06 kataliz

I have this problem too. My expire date stays always null. Is it a bug or am i using it wrong ?

MarekSlaninka avatar Jul 29 '15 07:07 MarekSlaninka

just save the expiry.. why do we even need the null check?

tjaved avatar Nov 03 '15 09:11 tjaved

Any updates? Still doesn't work

denis-minnetdinov avatar Mar 15 '16 14:03 denis-minnetdinov