21

I want to offer phone support in my app at the press of a button for iPhone users, and display a phone number for iPad/iPod Touch users. Rather than detecting what device the user has, is there a better way to query the hardware to see if it has telephony capabilities? This would continue to work should iPad 3G one day open up for voice calls.

I am aware of how to limit an app to devices through the UIRequiredDeviceCapabilities key, but I'm not looking to restrict platform, just detect capabilities.

Purpletoucan
  • 6,472
  • 2
  • 21
  • 28

1 Answers1

65

Check if application can open tel url:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+11111"]])
  // device has phone capabilities
Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • Thanks - this looks to be exactly what I'm looking for (minor revision to [NSURL URLWithString:@"tel:+11111"]). I have only tested on iPhone so far, but the simulator reports that it can't make calls whilst the real device claims that it can! Many thanks to both respondents! – Purpletoucan Sep 17 '10 at 14:32