如何检测手机应用程序是否可用于使用iphone os的各种设备 [英] How to detect if the phone app is available for various devices using iphone os

查看:134
本文介绍了如何检测手机应用程序是否可用于使用iphone os的各种设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据使用者是否可以拨打电话(iPhone或iPod touch),显示或隐藏可让使用者拨打电话的按钮。有可能以某种方式检测手机应用程序是否可用于可爱触摸的用户可用?或者我被限制检测设备类型,使这种区别?我宁愿检查功能比静态客户端,以防万一因为任何原因(不是iPod touch用户可以永远使非voip电话呼叫,但是代码会更干净)线路变化。

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).

推荐答案

BOOL canMakePhoneCalls = [[UIApplication sharedApplication]
                           canOpenURL:[NSURL URLWithString:@"tel:5555555"]];

这篇关于如何检测手机应用程序是否可用于使用iphone os的各种设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆