PDA

View Full Version : In App purchase - hide button when complete




ppn
Apr 4, 2011, 08:34 PM
I'm implementing an in app purchase and everything works fine in the sandbox environment but I can't seem to hide the "upgrade" button once the purchase is complete. I have a bool value to store whether the app has been purchased but after the purchase, I need to go to another view and come back before the upgrade button is hidden.

Any suggestions? I've followed the example in this website (http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/) for the in app purchase template. Is there a way to send a notification to my main view and request it to hide the button?

- (IBAction)upgrade:(id)sender{
InAppPurchase *inAppPurchase = [[InAppPurchase alloc] init];
[inAppPurchase requestProUpgradeProductData];
[inAppPurchase purchaseProUpgrade];
if ([[NSUserDefaults standardUserDefaults] boolForKey:kupgradePurchased] == YES) {
upgrade.hidden = YES;
}
}