调用restorePreviousTransactionsOnComplete后,MKStorekit isFeaturePurchased返回NO [英] MKStorekit isFeaturePurchased returns NO after calling restorePreviousTransactionsOnComplete
问题描述
我正在尝试使用出色的MKStoreKit为非消耗品实现恢复购买按钮.
I'm trying to implement a restore purchase button for a non-consumable product using the excellent MKStoreKit.
我在还原按钮上有错误代码:
I've got the folliwing code on the restore button:
[[MKStoreManager sharedManager] restorePreviousTransactionsOnComplete:^{
[_priceLabel completeWithText:NSLocalizedString(@"App restored :)", @"")];
} onError:^(NSError *error) {
[_priceLabel completeWithText:NSLocalizedString(@"Unable to restore", @"")];
}];
完成块被正确调用,但是当我调用
the completion block gets called correctly, but when I call
[MKStoreManager isFeaturePurchased:@"com.myapp.pro"]
我得到一个NO.感觉我缺少明显的东西吗?
I get a NO. Feel like I am missing something obvious?
推荐答案
如果这是在沙箱中(我认为是)-苹果实际上在约30秒内使订阅到期,即使它们应该持续一个月也是如此.
If this is in sandbox, which I assume it is - Apple actually expire subscriptions within about 30 seconds, even if they're supposed to last a month.
因此,最初您可能会收到一个提示,表明该订阅已激活,但是稍后(后来我指的是不久之后),答案将由Apple更改.
So initially you may get a that the subcription is active, but later (and by later I mean soon after), the answer will change from Apple.
这篇关于调用restorePreviousTransactionsOnComplete后,MKStorekit isFeaturePurchased返回NO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!