How to jump to dial pad in iOS - ios

To make a phone call, use [[UIApplication sharedApplication] openURL:#"tel://"] it's very easy.
The problem is: I don't want to dial immediately, I need when user taps the 'call' button, app jumps to dial pad in phone app, and displays specific phone number, user can press 'Call' button to make this phone call.
Anybody know how can I achieve this?
Appreciate!

iPhone SDK not allows you to dial a number from the application. But you can do it by using a UITextField. Set keyboard type to UIKeyboardTypePhonePad
textfield.keyboardType = UIKeyboardTypePhonePad;
and set that number to textfield,
textfield.text = numberToDial;
and then call the following line when user taps on your call button
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel://%#",textfield.text]]];

Related

How to open system's iPhone Dial pad in iOS app

The problem is: I don't want to dial immediately, I need when user taps the 'call' button, app jumps to dial pad in phone app, aand user enter's the phone number,then user can press 'Call' button to make this phone call.
[[UIApplication sharedApplication] openURL:#"tel://"]
This is not possible, however why don't you like the 'tel://' method since it keeps the user in your app once the call terminates? I haven't seen a single app that redirects to the call screen to dial a number since the call button is more simpler.

Directly launch phoneNumber dialog on iPad

If I use the UIDataDetectorTypePhoneNumber on a UITextView, and click a phone number on a device that has no phone (e.g. iPad), I get a Send Message / Add to Contacts / Copy popover. Is there some way to bring up that dialog directly in code or would I have to reimplement?
I did try [[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:5555555"]]; but that does not bring up the dialog.
There are some subtle differences between how detected links and buttons behave and my client wants a clickable phone number that behaves like a button.
I did some method swizzling to see where this popover comes from, and it looks like it is generated before the openURL: method in UIApplication.
Digging further, it looks like the popover comes from some private objects in UITextView.
I think you'll have to reimplement.
Did you try it with some forward slashes?
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://5555555"]];
Possibly related to this.
Use telprompt://5555555 instead of tel:5555555

remove the alert that pops up when calling from iOS app using telprompt://

I need to make a call from my iOS app, and after the user is done calling, i need him to come back on the same app screen from where he made the call. if i use the following code
NSString *phoneNumber = [#"telprompt://" stringByAppendingString:#"999999999"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
i achieve what i want, but get an unwanted alert confirming if the user wants to make a call or not. I don't want this.
If i use the code
NSString *phoneNumber = [#"tel://" stringByAppendingString:#"999999999"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
i do not get the alert, but i do not get back to my app screen too..!!
Is there a way where i do not get the alert while making the call and get back to the app screen after making the call?? please help..
You cannot do otherwise, those are the two possibilities. telprompt with alert and callback or tel with not coming back and no alert.
If the users leaves the app to make a phone call, there's no way you can return to your app after it. Your app is backgrounded, and the phone app is foregrounded.

opening dial pad for calling number user want

i want to open dial pad when user click on call button and then user enter phone number and call it
i know we can make call like this
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"telprompt://2135554321"]];
but i want to open dial pad and then let user enter number and press call button to call
if this is not possible then want to do something like my app open direct to dail pad then user call it and then it should redirect to my app
No you cant do this in iOS . iPhone SDK not gives you direct access to dial a numbers from the application .The one way to achieve this is
take a text field
textfield.keyboardType = UIKeyboardTypePhonePad;
and
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel://%#",textfield.text]]];
You have to see the format for entering the number.
Why not create a UIView that has a "UITextField" and when the text field comes up, have the keyboard set to only be numbers (i.e. pretty much the same thing as the dialpad).
And once they are done entering in the number, then you can call the "openURL" line you have above.

How do I make telephone numbers in iPhone clickable?

I have some telephone numbers in UILabel in various cells of a UITableView.
I also have telephone numbers in the subtitle of MKAnnotations in my MapViews.
How I can make these telephone numbers clickable so that they launch the phone app on the iPhone and dial the number?
Only UITextView handles this automatically.
Anything else will require you to make the call yourself (by responding to a tap, for instance):
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:15415551234"]];

Resources