我正在使用MKStoreKit 6.1,我正在尝试检查活动订阅,以下是代码:
- (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;
}但我非常担心它可能不起作用。如果订阅已过期,我不想授予用户访问权限,因此,如果订阅处于活动状态,我不想限制对他们的访问。
发布于 2019-07-07 16:02:28
这可能与这个错误有关:https://github.com/MugunthKumar/MKStoreKit/issues/270
只需确保代码中正确实现了毫秒转换
https://stackoverflow.com/questions/43697922
复制相似问题