I have integrated "In App Purchase" in a game to let the user unlock more levels. Everything works fine, but I have a little problem with the last alert "Thank You. Your purchase was successful. [OK]". My program gets informed that the transaction was successfully completed before this last alert pops up and so my game starts running again - then the alert comes up, annoying the user. I would like to wait with my game running until the user touches the "OK" button, but since it is an alert from StoreKit I have no idea when this happens or how I could catch it.
I don't want to create another dialog (this time my own, therefor under my control) below the alert, just asking for touching "OK" again - would be a bad user experience.
Anybody have any ideas?
1) set that storekit alert as delegate = yourclass.
2) Declare yourclass with the UIAlertViewDelegate, then use this method to intercept the alert:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
You can check the alert title/message to see if it's the correct alert:
if ([alertView.message isEqualToString:@"Thank you.. bla bla bla"]) {
//something
}
I'm having the same question. I found that whenever the user touches "OK" to that "Thank you" message, applicationDidBecomeActive:(UIApplication *)application
is called, so maybe this could be a way.
I'd like to know if someone has a better way though..
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