问题
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