开发者

How do I test if IOS device has telephone capabilities?

开发者 https://www.devze.com 2023-01-17 01:41 出处:网络
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 bette

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 UIRequiredDeviceCapab开发者_如何学运维ilities key, but I'm not looking to restrict platform, just detect capabilities.


Check if application can open tel url:

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

精彩评论

暂无评论...
验证码 换一张
取 消