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).
views:
193answers:
1
+2
A:
BOOL canMakePhoneCalls = [[UIApplication sharedApplication]
canOpenURL:[NSURL URLWithString:@"tel:5555555"]];
Ed Marty
2009-09-08 18:59:04
Thanks for the answer, i'll try it out as soon as i can!
Kevlar
2009-09-09 05:16:52
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
2010-05-10 16:07:56