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

fenrus110

macrumors regular
Original poster
Mar 24, 2008
142
0
I want to be able to touch an icon and have it call a number. It would also be nice if it didn't like interrupt or kill the running app. Is this even possible on the official iPhone SDK?

I've scoured all possible docs and even looked at the session topics at WWDC, and I see no mention of how to integrate your apps with making phone calls.

I know it can be done with a tag in Safari, but not sure how that would work since iPhone can only run one app at a time (Safari being one) meaning I would have to kill my app, open Safari, then make the call, but somehow retain the state of my app. And of course, somehow finding a way to make the transition smooth.
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
1. It looks like you don't have to go through Safari to use the phone app:
http://developer.apple.com/iphone/l...ion_1.html#//apple_ref/doc/uid/TP40006513-SW1 (You'll need to be registered to view this link).
You'll just need a correctly formed url (see the phone link).

2. This will close your app. But your app needs to be ready to save its state and close at any time anyway (and be capable of restoring state when next launched). This isn't adding any additional burden. Read that whole Programming Guide.
 

Pring

macrumors 6502
Sep 17, 2003
310
0
I've been wondering this also and came to the same conclusion.

What I'd like to see is a way to request that an app returns control to you afterwards. So your app closes when you make the call but when the call completes it starts up your app again and returns control. Would make things a lot smoother.
 

springframework

macrumors member
Mar 31, 2008
59
0
Does UIWebView have the ability to open up phone calls with:
<a href="tel:1-555-555-5555">1-555-555-5555</a>

?????????????
 

springframework

macrumors member
Mar 31, 2008
59
0
the documentation says it does without the <a href="tel:..></a>

so just 1-555-555-5555 as text should auto become a phone link.

its hard to test this on the emulator.

how do you test that you are clicking on a phone link? nothing seems to happen when i try this out.
 

iphoneGuy

macrumors member
I think you would need to add a button and have it do the dialing action:

Code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-800-555-1212"]]

Not sure if it works but it gives the same message that you get if you click on a phone number in a contact on the simulator.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.