Restore button for in-app purchase - is it the same as buying again?

I have written some code for a restore button;

-(IBAction)restore:(id)sender
{
[[MKStoreManager sharedManager]buyFeature]; 
}

-(void)productPurchased
{

for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
} 

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Thank you" message:@"Your restore was successful." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];


}

// error restore
- (void)failed
{
for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
}

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Your restore has failed." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];

}

But it prompts the user to 'buy' when they press it? Is this correct? I know essentially the same thing is happening as it is not going to charge them again, but I don't want to submit this code to apple only for them to reject it on the fact it doesn't make it clear enough?

Or have I done the code incorrectly?

Your help would be great appreciated,

Regards,

Agnelli

Answers


I think you want to call the method restorePreviousTransactionsOnComplete:onError:, not buyFeature.


Need Your Help