Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
275 views
Welcome To Ask or Share your Answers For Others

1 Answer

Check if application can open tel url:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+11111"]])
  // device has phone capabilities

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...