Prepare phone call from iOS app, without beginning the call - ios

I'm trying to begin a phone call from within my iPhone app (similar to several other questions already answered on SO), but with a specific wrinkle: my boss doesn't want the call to begin immediately. He wants the app to open the Phone app and autofill the number, but require the user to actually press the green button to begin the call.
Is this possible? All the research I've been doing has followed the...
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://911"]];
...pattern, which begins the call automatically as soon as it switches over.
Is it possible to prep the call and autofill the number, but not actually begin the call automatically?

as far as i know that is not possible. one thing you could do is for example present an alert and ask the user explicitly if he / she wants to make the call.

Related

iOS making a phone call from the app without a confirmation alert [duplicate]

This question already has answers here:
Prompt when trying to dial a phone number using tel:// scheme on iOS 10.3
(2 answers)
Closed 5 years ago.
My current enterprise iOS app includes an emergency 911 call feature for our guys in the field who often work under potentially unsafe conditions. The idea was that in case of a medical emergency, they could tap the "Dial 911" button and the phone would just dial.
In order to prevent a mistaken call, the user has a 10 second grace period to cancel the call, at the end of which the system will place the call. But in the unusual and extreme case where the user may be seriously incapacitated and unable to respond further, the call should go on through after the ten second gap.
I had all that working before the latest iOS update. Once the user tapped the "Call 911" button, the phone would complete the call without having to confirm. But now since the latest update, the phone has started showing a confirmation alert anyway.
Here's the line of code that I had been using which, until now worked fine:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel:%#",strEmergencyNumber]]];
The trick apparently being to use the tel: command.
I'm wondering if there is any other way to make the phone skip the confirmation alert. Otherwise, this may be a worthless function, with potentially fatal results.
Not trying to sound dramatic, but that's just the way it is. Ours is a sometimes-very dangerous business.
Thanks!
Unfortunately, what you desire to do is not possible, at least in the existing versions of iOS. That dialog will always show.
Per Apple's documentation for openURL:
When a third party application invokes openURL: on a tel://,
facetime://, or facetime-audio:// URL, iOS displays a prompt and
requires user confirmation before dialing.

Detect user's confirmation of iPhone call link?

The following code, if triggered by a button press in an app, presents the user with a UIAlertView giving them the option to "Cancel", and dismiss the UIAlertView, or "Call" and go through with dialing the number displayed to the user:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"telprompt://555-555-5555"]];
My question is: Is there a way to detect whether or not the user followed through with actually dialing the number? I am implementing Google "Analytics" in my app to see how users are interacting with it, and I can track when they tap the UIButton that calls the code above, but that doesn't necessarily mean they actually made the call.
Hopefully that makes sense. Thanks in advance for any help!
You won't be able to check the user dialed that specific number. But you will be able to check they dialed a number using CTCallCenter:setCallEventHandler:
If they made a call immediately after you present the view its 99.9% reasonable to assume it was that number.
But also your app delegate's willResignActive will get called if they place the call and get connected (I think, I can't remember exactly) so you could use that as an indication.

How to automatic confirm a call in telpromt confirm call alertview

im trying to make a call through the telpromt command:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"telprompt://123456789"]];
The problem is, that when de code is run, it displays an UIAlertView not of my property, asking to confirm the call.
It has to buttons: Cancel and Call.
I want to programatically press the call button in the AlertView.
Is it possible ?
Thanks !
iOS does this to protect the user from malicious applications which would try to make random calls. Anytime there are integrations to the phone, SMS, twitter, facebook, etc. apple requires the user to accept and allow the application to perform the action. This is why the iPhone displays a UIAlertView asking the user wether they really want to make a call to the phone number you're providing.

How to hide phone number when calling

My app allows the user to make a phone call but I need to hide the number I'm calling to because it has a secret code within it. Is there any way to achieve this?
When I say "hide the number", I mean the phone number that appears in the the confirmation UIAlertView before calling and, if possible, in navigation bar when the call is in process.
Most definitely not. The phone number that gets passed to the OS when making the call cannot be modified or hidden from the user. (What if your app dialed 911?)
Also, how is a "secret code" passed via a telephone number?
Are you using the native phone number recognition code within a web view, or is this a custom button in your app.
In an app I've created, I have a button that the user can tap to call a phone number. This button presents a UIAlertView that I create myself (and therefore have complete control over what it says), and then in the alertView:didClickButtonAtIndex: delegate method, I do:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://5555555555"]];
to initiate the call.
I think if you try to modify the way how ios Phone app works, your app might be rejected. I'm almost sure they will not happy to let your app dail a number without user's knowledge.

Way to call a phone number along with passing a image

I need to know is there a way to call a phone number along with passing a image to display.... also if i could get the call duration, or set some notification for particular time....
One way is to call using
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://123456789"]];
but then my application would go in backgound , how to i call my application after phone call end...
What you are asking is almost not possible.
Im saying allmost because it might be posibbole to
add a temporary contact to the
address book with the phone number you want.
set its image to the image you want.
paste the call with the method you wrote.
but still there are 2 problems.
you will have somehow to delete the contact afterwords.
you can not do the things you asked from the background. and you can not do nothing when a call is active.

Resources