MugunthKumar / MKStoreKit

The "Goto" In App Purchases Framework for iOS 8+
2.09k stars 430 forks source link

Wrong logic in Expire Date for subscriptions #239

Open kataliz opened 9 years ago

kataliz commented 9 years ago

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 ?

MarekSlaninka commented 9 years ago

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

tjaved commented 9 years ago

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

denis-minnetdinov commented 8 years ago

Any updates? Still doesn't work