lewis
lewis

Reputation: 3202

MKStorekit isFeaturePurchased returns NO after calling restorePreviousTransactionsOnComplete

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?

Upvotes: 2

Views: 713

Answers (2)

GameArrivals
GameArrivals

Reputation: 3

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.

Upvotes: 0

Mugunth
Mugunth

Reputation: 14509

If yours is a subscription product, you should use isSubscriptionActive

Upvotes: 1

Related Questions