Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ppn

macrumors member
Original poster
Oct 31, 2010
36
0
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 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?

Code:
- (IBAction)upgrade:(id)sender{
    InAppPurchase *inAppPurchase = [[InAppPurchase alloc] init];
    [inAppPurchase requestProUpgradeProductData];
    [inAppPurchase purchaseProUpgrade];
    if ([[NSUserDefaults standardUserDefaults] boolForKey:kupgradePurchased] == YES) {
        upgrade.hidden = YES;
    }
}
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.