Reputation: 113
in our app I have a purchase button & a restore button however I would like to make it so that instead of 2 seperate buttons I can just use one, which then prompts what to do.
Would anyone be able to assist in editing the code below so that when the user clicks the button, a UIAlert pops up with one button to say Upgrade, one to say Restore, the other Cancel.
Here is the current code used to buy / restore;
-(IBAction) actionRemoveAds
{
[[MKStoreManager sharedManager] buyFeatureA];
}
-(IBAction) actionRestore
{
[MKStoreManager sharedManager];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag==111) {
if (buttonIndex==0) {
[[MKStoreManager sharedManager]buyFeatureA];
}
}
}
Many thanks, Chris
Upvotes: 0
Views: 216