views:

193

answers:

1

I'd like to show or hide a button that lets a user make a phone call based on whether or not the user can actually make a call (iPhone or iPod touch). Is it possible to somehow detect if the phone app is available to the user in cocoa-touch? Or am i constrained to detecting the device type to make that distinction? I would rather check for functionality than static clients in case something changes down the line for whatever reason (not that iPod touch users could ever make non-voip phone calls anyways, but the code would be cleaner).

+2  A: 
BOOL canMakePhoneCalls = [[UIApplication sharedApplication]
                           canOpenURL:[NSURL URLWithString:@"tel:5555555"]];
Ed Marty
Thanks for the answer, i'll try it out as soon as i can!
Kevlar
I like this solution in particular because it allows a user to install some other app to support tel:// on a device missing hardware phone.
Billy Gray