Braintree Cancel button handling - iphone

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.

Related

IN-App Purchase Pop-up Text

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.

can any one tell me the name of alert view that should do the works of **C# show dialog**

can any one tell me the name of alert view that should do the works of C# show dialog .
other actions will not work without dismissing it(EVEN DELEGATES ALSO).
Modal dialogs in Windows (in any language) and in iOS are fundamentally different.
On Windows, a modal dialog (and in particular the ShowDialog method) behaves like a function call that will only return when the dialog is closed. Your app will naturally wait until the your has made his decision.
On iOS, presentModalViewController (or [UIAlertView show]) almost immediately return. You can registered a delegate that will be notified when the dialog is closed. But if your app is supposed to wait only the user has chosen something in the dialog, then you have to implement the waiting yourself.
As far as know, You have to do this manually. You can lock your task when the alert is shown and then unlock it again when it is dismissed getting help from these posts.
is there a way to pause an NSTHread indefinitely and have it resumed from another thread?
How to pause an NSThread until notified?

iPhone: View/Close button click action on push notification message dialog

Could anyone please tell me how to handle push notification dialog's view and close button click from my application? I have gone through this thread which says to handle it in ViewDidLoad but when I click View button, this method doesn't get invoked. I want to do take user to some particular view on View button click and record the Close button click on my Server. So basically I want to know what happens when this button(s) clicked? I have gone through Apple docs but it nothing say about these actions. Any documentation and/or code sample would be really greatful.
Thanks.
If user clicks view then you can catch that action in didFinishLaunchWithOptions method of AppDelegate class. If user clicks close then, there is no way for application to catch that. If your application didn't get the notification in AppDelegate class, then either you forgot to register your app for push notification or you didn't send push notification properly to APNS.

iphone: what event will be fired if we close a notofiaction without viewing it

I have a situation say I have to print Notification viewed when local notification is viewed and Notification closed when close button of notification is clicked basically I want to know if we have an event/method which is fired once the notification's cancel button is pressed.
If this is not possible then do we have a method which got fired when the notification is displayed or pushed?
Please shed some light on this.
Your app isn't running, so there is no way to interact with the OS.
The OS will display the localnotification, thus there is no way to either check if the notification is displayed or the cancel button is pressed.

Deferentiating the push notification handler when application is foreground and background

It is said that (correct me if I'm wrong) if the application is in the foreground we have to handle push notifications in the "didReceiveRemoteNotification" and if the application is in the background using "didFinishLaunchingWithOptions" when user taps the "view" button of the app. As I dont have a phone to test I want to know whether I am handling this properly.
1) What will be invoked when I taps on the "View" button in the push notification?
2) Let say I am running the application in the foreground and push notification receives at the same time. Will I be given the push notification alert? If so what will happen if the user click on the View button?
3) In this thread How to handle push notifications if the application is already running? it says:
"alert" key will not be there directly under the userInfo dictionary, you need to get another dictionary with name "aps" and then get the "alert" or "body" from "aps" dictionary"
Is this true?
4) I need to push to a certain view when the user clicks on the View button. Hence do I need to handle that code in both methods?
Thank you
There's a nice rundown of the methods invoked by a push notification in this Apple vid: http://developer.apple.com/videos/iphone/#video-advanced-pushnotification - make sure you visit download the full version in iTunes.
This direct link might work: http://developer.apple.com/itunes/?destination=adc.apple.com.3391495696.03391495702.3416205190?i=1378617410
Either way, the general idea is that if your app isn't in the foreground, tapping your view button will trigger didFinishLaunchingWithOptions, and if it is the foreground app, you'll get the didReceiveRemoteNotification.
I don't think you'll get the alert. The method didReceiveRemoteNotification will be called, and it'll be up to you to show a UIAlert if you want.
Yes - that's true.
Yes, but I think you can simplify this by creating a third method specifically designed to handle your view. You can call this from both didFinishLaunching (only if it launched via a notification), and didReceiveRemoteNotification. This way, if your app needs to be launched, you can have time to do any other setup you might need to do for the app to work right out of the get-go (load saved data, init tabbar controllers or anything else like that).
Best of luck