LilMoke
LilMoke

Reputation: 3454

How to restore purchases using MKStoreKit

My app was rejected from apple because it does not have a restore button, but I am using MKStoreKit, so if the app is purchased and the the device is wiped and the user click my purchase button again, it does re-download and 'restore' the app.

So, can someone explain what they are asking me to do? I thought MKStoreKit handled this for me.

Thanks

Upvotes: 0

Views: 3256

Answers (3)

Gero
Gero

Reputation: 51

Just call restorePreviousTransactionsOnComplete

#import "MKStoreManager.h"

-(void)restorePreviousPurchase{
    [[MKStoreManager sharedManager]restorePreviousTransactionsOnComplete:^{NSLog(@"RESTORED PREVIOUS PURCHASE");} onError:nil];
}

Upvotes: 5

Gravemind
Gravemind

Reputation: 55

- (IBAction) RestoreCompletedTransactions:(id)sender
{
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}

Not sure about the button though, I guess mine is always displayed.

Upvotes: 1

rckoenes
rckoenes

Reputation: 69499

Somewhere in your app you need to add a restore button, which will allow the user to restore there previous purchases.

MKStoreKit does all this, but you will need to add the button to UI your self. Then you can call the restorePreviousTransactionsOnComplete:onError: method on MKStoreManager

Upvotes: 1

Related Questions