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?
That's the thing. It's not complete before I check for it. Does the in app purchase return anything once the purchase is complete? Can the in app purchase call on anything to hide the button for me?
If I put the line below then I get warning: Sending 'MainViewController' to parameter of incompatible type 'id<SKPaymentTransactionObserver'. I don't have all my inapp purchase in my mainviewcontroller.
In my mainview.m file I have. I put a debug code and when I finish with the in app purchase, it doesn't look like the updatdTransaction method is being called. The debug code doesn't show up on the console. I have to go to another view and then come back for the upgrade button to be hidden.
You added the InAppPurchase object as your observer, but the method you want called is in MainViewController. Which way do you want it? It looks to me like you should replace inAppPurchase with self in that line. And maybe even move it to be before the InAppPurchase alloc line.