Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kiezarsoze

macrumors newbie
Original poster
Mar 23, 2008
5
0
does anyone know how to dial a phone number programmatically by calling an iphone sdk function which launches the phone app with a phone number as a parameter?

cheers!
 

drivefast

macrumors regular
Mar 13, 2008
128
0
use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.
 

kiezarsoze

macrumors newbie
Original poster
Mar 23, 2008
5
0
iphone sdk dialing a phone number

use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.

I tried this and get a negative result.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:"http://tel:1-800-275-2273"]];

this causes my program to exit and safari to launch (ok with me I know that apps can't run in the bg). However, safari reports "can't open the page" It shows the url in it's own window as I have it in quotes above. Furthermore, it reports the error "The error was: Cannot show URL"

Then I tried this:

I changed the string so that instead of http:// it says tel://

following this is the same phone number.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:"tel://1-800-275-2273"]];

Now I get an alert in my app saying "Unsupported URL. This URL wasn't loaded: tel://1-800-275-2273"

I have tried this also by removing the dashes to no avail.

HELP!

---

NEXT QUESTION:

Assuming I simply got the syntax wrong and this should work, what will happen when using an ipod touch? Is there a way to check if the app is running on an ipod touch or an iphone?

-----

FINNALY, I know I have asked this question a few times already, can anyone tell me how to get the iphone number out of the sim card? I want to be able to make a phone call and record which phone made the phone call. I suppose I can ask the user to enter their own phone number into my app but this would be a pain in the ass and open to error and hacking.
 

drivefast

macrumors regular
Mar 13, 2008
128
0
hm, i either had it wrong, or they just changed the syntax recently (more probably i had it wrong first time i posted). according to apple the correct syntax for a hyperlink is
Code:
<a href="tel:1-408-555-5555">1-408-555-5555</a>
so i would try your code as it is, with the two forward slashes removed.

on the ipod touch there is no telephone application, so i assume no other app registers the tel: URL scheme, therefore you may get a message similar to what youre getting now.

still no way that i know to get the user's own phone number.
 

TAKEphONE

macrumors newbie
Jun 30, 2008
21
0
Hi all,

Just want to make sure - before I plunge into development...

- Can I initiate a phone call to a specific phone number (and name) from within my own application ?

- Will it always involve the user seeing Saffari on screen, and having to approve the dialing (on every call) ?

- Can I make a call to a number with "extra digits" (i.e. call 1-800-222-3333, wait for answer, then dial other touch-tone digits, wait 2 sec, then dial ...) ?

- Can my app be notified about telephony events, such as call progress, incoming call, etc. ?

Thanks in advance !
 

Pring

macrumors 6502
Sep 17, 2003
310
0
Hi all,

Just want to make sure - before I plunge into development...

- Can I initiate a phone call to a specific phone number (and name) from within my own application ?

Yes you can.

- Will it always involve the user seeing Saffari on screen, and having to approve the dialing (on every call) ?

Yes, otherwise you could make your users dial premium rate phone numbers without them knowing what they're calling! The user must approve the call.

- Can I make a call to a number with "extra digits" (i.e. call 1-800-222-3333, wait for answer, then dial other touch-tone digits, wait 2 sec, then dial ...) ?

- Can my app be notified about telephony events, such as call progress, incoming call, etc. ?

Thanks in advance !

Not really, no. Once you pass off to make the call your application will no longer be running. The user can enter touch tone digits etc but your app won't know what they've done. For the same reason you can't get notifications of telephony events.
 

TAKEphONE

macrumors newbie
Jun 30, 2008
21
0
Thanks, all !

On some dialed automated systems, it is better that the dialer stops and asks prompt the caller when to continue dialing the extra digits.

Some more questions, if I may:

- Can I access the call-log ?
- Can I access the speed-dial list ?

Thanks.
 

dgelfuso

macrumors newbie
Jul 17, 2008
2
0
I am trying to use the tel:// function to dial AT&T Voice Dial which is either *8, *08, or #121 but the * and # are always stripped when I use the tel:// function.

How can I get around this?
 

Pring

macrumors 6502
Sep 17, 2003
310
0
Try escaping them by putting a \ in front of them. They're special characters so are likely being stripped.
 

TAKEphONE

macrumors newbie
Jun 30, 2008
21
0
Hi all,

Is there a way to read the "recents" list (calls log) ?

Is there a way to read the "favourites" list ?

Thanks.
 

schimanke

macrumors member
Feb 19, 2008
93
1
Has anyone found a way to include special characters in phone numbers?

My code looks like URLWithString:mad:"tel://**62*3311#" but anytime the app reaches the point where it should start dialing it just does nothing. When I include tel://**62*3311# as a hyperlink on a website, it strips off the * and #.
 

TAKEphONE

macrumors newbie
Jun 30, 2008
21
0
use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.

Hi,

Is there no way for an app to start a call without the user having to confirm the call ?

I bumped into several apps that start calls without a confirmation dialog - are they using a "hidden function call" ?

(maybe they were written using the "unofficial sdk" ?)

Thanks.
 

racemize

macrumors member
Jul 2, 2007
63
0
no confirmation!

I know there is a way to dial without confirmation (which I think means using something other than the tel: url). There are a ton of apps in the app store, so how are they doing it? I hate when these features are hidden and to implement a simple feature you spend more time trying to find it instead of programming... Someone help!
 

TAKEphONE

macrumors newbie
Jun 30, 2008
21
0
I know there is a way to dial without confirmation (which I think means using something other than the tel: url). There are a ton of apps in the app store, so how are they doing it? I hate when these features are hidden and to implement a simple feature you spend more time trying to find it instead of programming... Someone help!

Hi,

I have been using the tel: url on a real iPhone device, and there was no confirmation dialog.

I guess the confirmation dialog only appears when the url is used from a web page, not when using it programatically.
 

beachdog

macrumors member
Aug 10, 2008
86
0
Hi,

How do I represent pauses ?
When I tried commas - it just ignored them.

When I downloaded and ran the calling card app, which supports postdial pauses, it seems to use commas as the means to indicate a pause. The iphone documention, however, references the tel url as defined in RFC 2806, which has a different means for specifying postdial delays -- it specifies the use of the character "p" to indicate a one-second delay, only appearing after a ";postdial=" fragment.

Does anyone know if the SDK truly and fully suports RFC 2806 ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.