0

I am using MKStoreKit 6.1 I am trying to check the active subscription, here is the code:

- (BOOL) userHaveActiveSubscribe {
NSArray *myProductIds = @[oneMonthSubscribe, oneYearSubscribe, sixMonthSubscribe];
for (NSString *productId in myProductIds) {
    if([[MKStoreKit sharedKit] isProductPurchased:productId]) {
        if ([[MKStoreKit sharedKit] expiryDateForProduct:productId]) {
            if([[NSDate date] compare:[[MKStoreKit sharedKit] expiryDateForProduct:productId]] == NSOrderedAscending) {
                NSLog(@"USER HAVE ACTIVE SUBSCRIBE (%@)",productId);
                return YES;
            }
        }
    }
}
return NO;
}

But I'm very worried that it might not work. I would not like to give users access if the subscription has expired, so I would not want to restrict access to them if the subscription is active.

4

1 回答 1

0

这可能与此错误有关:https ://github.com/MugunthKumar/MKStoreKit/issues/270

只需确保在代码中正确实现了到毫秒的转换

于 2019-07-07T08:02:27.627 回答