MKStorekit isFeaturePurchased returns NO after calling restorePreviousTransactionsOnComplete

痞子三分冷 提交于 2019-12-24 03:39:20

问题


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"]

I get a NO. Feel like I am missing something obvious?


回答1:


If yours is a subscription product, you should use isSubscriptionActive




回答2:


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.

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.



来源:https://stackoverflow.com/questions/13720037/mkstorekit-isfeaturepurchased-returns-no-after-calling-restoreprevioustransactio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!