I am facing a strange issue. When a user presses a button for cancel in in-app purchase pop-up hides at that time but the pop-up comes twice when he presses the cancel button again. This is getting replicated 100%.
Any suggestions?
It's probably somewhere in the line of implementing
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
after calling SKPaymentTransactionStatePurchased. If you are expecting more assistance, perhaps, you should show your code in the first place.
Related
Just use sandbox mode and press on Pay button after entering the details. once the payment is started processing, press cancel button immediately. This will call the cancel method where we are calling dismissViewController but at the same time after dismissing the payment view payment succeed delegate is also called. And we have nothing there to check whether fail or success or something else. Also i have tried to take class reference and set it to nil in cancel delegate. Help me if anyone faced the same.
Ok
On first run I ask for the mobile phone number in an alertview. This is using - (void)textFieldDidEndEditing:(UITextField *)textField to validate the phone number.
Now I also have push notifications.
The trouble is when the app is first installed the alertview shows and the keyboard shows but the "Do you want to enable push notifications" alert also shows. So whats the problem? Well the alert shows then over the alert the push notification shows blocking the input box. Then the keyboard shows blocking the "Yes/No" buttons of the push notification.
Therefor I cannot dismiss or answer either alert! So my first thought is to comment out [passwordField becomeFirstResponder]; for the phone number alert and the keyboard can be dismissed but then my validation never gets called. :(
Any suggestions will be appreciated.
You have to delay your register for push notifications code until after your UI is done.
I'm showing custom indicator when user clicks a button to purchase an in-app item.
The custom indicator calls 'beginIgnoringInteractionEvents' on init.
However the apple provided in-app-purchase popup(to show item name/price) is still touchable.
Well, that's all good, but I tried adding another UIAlertview on the process(after user confirms the purchase and apple validates it), because the purchase process takes a while and it just seems boring with only being able to see indicator spinning.
Now the problem is, the UIAlertView I added is not touchable.
How is apple's alertview(in-app-purchase pop-ups) touchable and not mine?
The in app purchase box seems to count as a different process, separate from your app as it calls applicationDidBecomeActive: and applicationWillResignActive: similar to the text message box.
This would explain why it can receive touches, but views internal to your app can't
I put an in app purchase into my app, and when the user taps a button, the purchase is started. So basically, they tap the button, and then depending on the speed on their Internet connection, they could be waiting for up to ten seconds until a new alert view comes up asking if they would like to buy the product. The user will probably tap the button multiple times since nothing came up, and then multiple purchase alert views will come up. Additionally, this could maybe be seen by the user as an app bug. In the end, this is a problem.
I want an alert view to come up with a spinning wheel that says "Loading..." when the users taps the buy button. Now my problem is, how do I get that to dismiss when the new alert view comes up asking the user if they want to buy the product?
if ([UIAlertView alloc] that says: #"whatever Apple's alert view says")
{
//dismiss the "Loading..." alert view here
}
I doubt that would work, so any input is appreciated. Thanks!
You need to have access to that alertview. You can do this. Create a alertview instance var in app delegate and when you want to show loading initialize that instance var assign to your property and when you want to dismiss just call
[alertViewinstance dismissWithClickedButtonAtIndex:0];
Write this piece of code in a method in appDelegate. Hope you get the idea. If not let me know I'll post the sample code here.
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?
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..
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 think Irene in on the right path. I had this same problem and scoured the "Interwebs" to find an answer, and it seems that there is none.
For the purposes of your game, I would recommend pausing and resuming the game in response to your applicationDidBecomeActive: and applicationWillResignActive: UIApplicationDelegate methods. Not only will this cause the game to be paused until the user dismisses the successful purchase alert, it will also pause the game when a text message is received, a phone call is received, or any other event causes the application to be interrupted.
While annoying in this case, adding automatic pausing and resuming of your game will add a very user-friendly feature that your users will appreciate.