Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 14, 2008, 01:04 PM   #1
kiezarsoze
macrumors newbie
 
Join Date: Mar 2008
iphone SDK dial a phone number

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!
kiezarsoze is offline   0 Reply With Quote
Old May 14, 2008, 01:05 PM   #2
Peace
macrumors P6
 
Peace's Avatar
 
Join Date: Apr 2005
Location: Space--The ONLY Frontier
Unless you have the actual beta firmware on the physical iPhone it can't be done.
Peace is offline   0 Reply With Quote
Old May 16, 2008, 04:40 PM   #3
drivefast
macrumors regular
 
Join Date: Mar 2008
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.
drivefast is offline   0 Reply With Quote
Old Jun 8, 2008, 01:33 PM   #4
kiezarsoze
Thread Starter
macrumors newbie
 
Join Date: Mar 2008
iphone sdk dialing a phone number

Quote:
Originally Posted by drivefast View Post
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:@"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:@"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.
kiezarsoze is offline   0 Reply With Quote
Old Jun 10, 2008, 02:07 PM   #5
drivefast
macrumors regular
 
Join Date: Mar 2008
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.
drivefast is offline   0 Reply With Quote
Old Jun 30, 2008, 09:44 AM   #6
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
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 !
TAKEphONE is offline   0 Reply With Quote
Old Jun 30, 2008, 12:59 PM   #7
Pring
macrumors 6502
 
Join Date: Sep 2003
Quote:
Originally Posted by TAKEphONE View Post
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.

Quote:
- 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.

Quote:
- 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.
Pring is offline   0 Reply With Quote
Old Jun 30, 2008, 01:34 PM   #8
izibo
macrumors 6502
 
Join Date: Oct 2004
Couldn't you just throw in a few pauses before the tones?
izibo is offline   0 Reply With Quote
Old Jun 30, 2008, 01:45 PM   #9
Pring
macrumors 6502
 
Join Date: Sep 2003
Quote:
Originally Posted by izibo View Post
Couldn't you just throw in a few pauses before the tones?
Good idea. He could put in pauses using one or more commas.
Pring is offline   0 Reply With Quote
Old Jul 1, 2008, 01:32 AM   #10
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
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.
TAKEphONE is offline   0 Reply With Quote
Old Jul 17, 2008, 11:48 AM   #11
dgelfuso
macrumors newbie
 
Join Date: Jul 2008
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?
dgelfuso is offline   0 Reply With Quote
Old Jul 17, 2008, 12:39 PM   #12
Pring
macrumors 6502
 
Join Date: Sep 2003
Try escaping them by putting a \ in front of them. They're special characters so are likely being stripped.
Pring is offline   0 Reply With Quote
Old Jul 17, 2008, 01:10 PM   #13
dgelfuso
macrumors newbie
 
Join Date: Jul 2008
Quote:
Originally Posted by Pring View Post
Try escaping them by putting a \ in front of them. They're special characters so are likely being stripped.
Thanks, but the "\| didn't work.
dgelfuso is offline   0 Reply With Quote
Old Aug 10, 2008, 04:13 AM   #14
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
Hi all,

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

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

Thanks.
TAKEphONE is offline   0 Reply With Quote
Old Aug 18, 2008, 08:31 AM   #15
schimanke
macrumors member
 
Join Date: Feb 2008
Has anyone found a way to include special characters in phone numbers?

My code looks like URLWithString:@"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 #.

Last edited by schimanke; Aug 18, 2008 at 08:41 AM.
schimanke is offline   0 Reply With Quote
Old Aug 24, 2008, 03:14 AM   #16
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
Quote:
Originally Posted by izibo View Post
Couldn't you just throw in a few pauses before the tones?
Hi,

How do I represent pauses ?
When I tried commas - it just ignored them.
TAKEphONE is offline   0 Reply With Quote
Old Aug 24, 2008, 06:35 AM   #17
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
Quote:
Originally Posted by drivefast View Post
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.
TAKEphONE is offline   0 Reply With Quote
Old Aug 31, 2008, 07:18 PM   #18
hlysmksbtmn
macrumors member
 
Join Date: Aug 2008
anyone know how to programmatically dial a contact in my address book?
hlysmksbtmn is offline   0 Reply With Quote
Old Aug 31, 2008, 08:11 PM   #19
admanimal
macrumors 68040
 
Join Date: Apr 2005
Quote:
Originally Posted by hlysmksbtmn View Post
anyone know how to programmatically dial a contact in my address book?
You need to extract their phone number using the address book APIs and then call it using a tel:// URL.
admanimal is offline   0 Reply With Quote
Old Sep 23, 2008, 10:32 PM   #20
racemize
macrumors member
 
Join Date: Jul 2007
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!
racemize is offline   0 Reply With Quote
Old Sep 23, 2008, 11:17 PM   #21
TAKEphONE
macrumors newbie
 
Join Date: Jun 2008
Quote:
Originally Posted by racemize View Post
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.
TAKEphONE is offline   0 Reply With Quote
Old Dec 1, 2008, 09:31 AM   #22
ndefreitas
macrumors newbie
 
Join Date: Dec 2008
Dialing from a native app...

This link explains how it's done: https://developer.apple.com/iphone/l...honeLinks.html
ndefreitas is offline   0 Reply With Quote
Old Dec 3, 2008, 11:07 AM   #23
beachdog
macrumors member
 
Join Date: Aug 2008
Quote:
Originally Posted by TAKEphONE View Post
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 ?
beachdog is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Select number text on Mac, send to phone and dial adam9c1 Mac Applications and Mac App Store 0 Jan 1, 2014 01:10 PM
[Free] Point & Dial | Just point to dial a number plescape iPhone and iPod touch Apps 3 Sep 26, 2013 06:37 PM
Number to dial to update Verizon towers? sk1wbw iPhone 9 Oct 4, 2012 09:55 AM
iPhone 4s phone number oscarm iPhone 15 Aug 6, 2012 01:20 AM
iPhone Phone Number That-Guy iPhone 1 Jul 2, 2012 07:34 PM

Forum Jump

All times are GMT -5. The time now is 09:06 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC