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?
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: