MKSG-MugunthKumar / MKStoreKit

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

Wrong check for expired subscription #270

Open kittipongm opened 6 years ago

kittipongm commented 6 years ago

On line: if ([[NSDate date] timeIntervalSince1970] > [expiresDateMs doubleValue]) {

The expiresDateMs is milliseconds but the first one is in seconds.

tommyz commented 6 years ago

Try to write this. if ([[NSDate date] timeIntervalSince1970] > ([expiresDateMs doubleValue] / 1000.0f) ) {

        [[NSNotificationCenter defaultCenter] postNotificationName:kMKStoreKitSubscriptionExpiredNotification object:productIdentifier];
      }