提问人:JSA986 提问时间:7/31/2021 最后编辑:JSA986 更新时间:7/31/2021 访问量:44
MKStoreKit 自动续订订阅到期日期始终返回当前日期
MKStoreKit Auto Renewing Subscription Expiry Date Always Returns Current Date
问:
使用 MKStoreKit 进行自动续订订阅。在沙盒中购买成功。问题是购买日期和到期日期始终记录为相同,或比当前日期晚 1 小时。随着沙盒时间的加快,我预计会提前 30 分钟左右购买,因为这是六个月的购买时间。我得到的当前日期正好比交易晚了 1 小时。[[MKStoreKit sharedKit] expiryDateForProduct:@"211112"];
[NSDate date]
登录购买:
Transaction date is 2021-07-30 4:15:07 pm +0000
Subscription end date is Fri Jul 30 17:15:07 2021
重新加载时,日志会打印该订阅到期日期和当前日期完全相同
重新加载日志:
1. Current time and date: Fri Jul 30 17:02:42 2021
2. Expiry date for subscription 6 months = Fri Jul 30 17:02:42 2021
从 MKStoreKit 中的代码来看,购买日期似乎可能返回 NULL 并返回当前日期
-(NSDate*) expiryDateForProduct:(NSString*) productId {
NSNumber *expiresDateMs = self.purchaseRecord[productId];
if ([expiresDateMs isKindOfClass:NSNull.class]) {
return NSDate.date;
} else {
return [NSDate dateWithTimeIntervalSince1970:[expiresDateMs doubleValue] / 1000.0f];
}
}
[[MKStoreKit sharedKit] valueForKey:@"purchaseRecord"]
购买退货<null>
答:
0赞
JSA986
7/31/2021
#1
这是不正确的应用密码MKStorekitConfigs.plist
评论