When one of my in-app transactions is completed, either because it is restored or because it is a successful purchase, Store Kit generates an alert view that displays a confirmation dialog box. In this current version it says "Thank You. Your Purchase was successful.".
Since my app should move to a different screen after a purchase is successful, I want to intercept that dialog box and not make the transition until it is dismissed by the user. The problem is that I don't seem to have any control over that dialog box. Anyone has any ideas of how to do it?
Thanks!
Don't try. Your payment delegate is notified when a purchase goes through--use that mechanism. Those alerts are part of the AppStore.app binary and aren't executed in your process, so you can't touch them.
You can use the fact that the app becomes inactive when those StoreKit alerts pop up:
Check UIApplication's activeState property after the purchase is finished if it's 'inactive', then delay your movement to a different screen until the state changes to 'active' again (monitor for UIApplicationDidBecomeActive notification).
'activeState' property is not supported on firmwares older than 4.0, but you can still track app state changes manually and know its state at any time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With