Present iPhone dial pad with a number but not actually place the call - iphone

I know how to open a tel:// URL so that I can launch a call on an iPhone, but I'm wondering if there's a way to just have the phone app launch and wait for the user to press the call button.
Is this possible?

what i do is present a UIAlertView asking for confirmation ... if the user presses Call then i go ahead with the request... If he presses Cancel the app does nothing other than removing the alert view from screen ...

Related

To show an alert when application just enter into background

I just want to show an alert when user just quit the application before application entering the background, how can I do that??
If I show the alert in applicationDidEnterBackground:(UIApplication *)application method then this alert will be shown when we again resume the application, but I need to show the alert before the application enters the background.
You can't do this, and rightly so. When the user presses the home button, they go to the home screen. This is a fundamental part of the iOS user experience. Nothing stops the home button working.
applicationWillResignActive and applicationWillTerminate may be of interest to this general question—but you can't present anything into the UI once the home button is pressed. These methods do let you briefly run any critical code however, while the home screen is being presented to the user.

IPHONE - How to make a disclaimer?

my app is almost finished and since is for airline pilots I would like to add a disclamer (like an alert view...but more like a scroll view) that pop up as soon as they start the app and if they don't press ok I want to exit from the app. Any advice would be really appreciated.
thanks
Just use a UIAlertView — if you put a lot of text in it, it automatically scrolls.
If the user presses the "No" button, you need to just disable the app rather than exit — apps aren't allowed to exit unless the user presses the home button. You could pop up a modal view controller (with no way of dismissing it) with a message saying that the app cannot be used until the disclaimer is read and accepted.

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

Exiting or interrupted?

Is there a way to differentiate when a user is exiting an app because he/she pressed the home button or because it's receiving a phone call? in iOS 4.0 the app doesn't quit if the user answers a call but it does in 3.x.
I'd like to save my app state if the user is interrupted by a call or any other phone event but not if the user exits the app by pressing the home button.
Any advice??
The following application delegate methods get called in different situations:
applicationWillTerminate - user pressed "home" button and application is about to exit
applicationWillResignActive - user got incoming call or sms alert. if he decides to accept the call the application will quit
applicationDidBecomeActive - user ignored incoming call
applicationDidEnterBackground - user pressed "home" button and application went to background mode - applicable for platforms that support multitasking
So it seems you need to use applicationWillResignActive: method in app delegate to distinguish between your two cases

iPhone Application Should Close, not go to Background

I have an application wherein when the user taps iPhone's central button, the application is sent to background, but I want it to be closed.
I can hand event and close it, but may be there is some configuration setting to deny running in the background?
Thank you
If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend to YES in your app's Info.plist file. If you do this, when the user taps the home button the applicationWillTerminate: method of your app delegate will be called and then your application will terminate.