How can I do a call in ios? - ios

I need to do a call in background to a number and, if is possible, to enter a code during the call. Can I do this?
This call must be done via user's phone!

in background? No. You can always use
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:#"tel:1234567890"]];
to make a call, but it will open the Phone app

Related

Implement phone call lengh monitoring iOS

I can make user to call from my app. I want to get the length of the call in my app, Once the call is ended
No,You can't get that officially.As once you initiate telprompt:// it would leave your application & once the call has been ended there is no delegate to be called later and you are outside your app.You can't access any call related information in non-jailbroken phone.
Well below link will surely help.
https://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/
But for sure, for sure Apple will reject the app.

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.

How to hang up a call automatically?

I'm very interesting to know how to hang up a call automatically. If I push my call button
(this is it's code):
-(IBAction)callPhone:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phone.text]];
}
I want to hang up the call after 5 seconds automatically. How can I do that?.
Thanks.
That is outside the scope of the iOS SDK. You can't tell the phone subsystem to do anything. This merely invokes the system to do something.
you can't, you can initiate call from your app but you can't hang up.

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