How to check Facetime Support in iOS devices (hardware check)

廉价感情. 提交于 2020-01-03 05:01:10

问题


I want to check if iOS device I am using has support for Facetime call. I don't want to check the iOS version on the device, rather if the device has the hardware support to initiate a Facetime call.

For example: I have an iPad 1 with iOS version 4.0 and above, but if I don't have a camera (or a front camera), the Facetime call should not initiate. How can I do this?


回答1:


Try using canOpenUrl method with FaceTime scheme, as follows:

[[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString: @"facetime://5555555555"]];



回答2:


you could check if the device responds to hasTorch

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 
if ([device hasTorch]) { 
//do stuff
}

this way you know they can handle facetime, so maybe show an alert asking them to ensure facetime is enable before initiating a call?



来源:https://stackoverflow.com/questions/8516188/how-to-check-facetime-support-in-ios-devices-hardware-check

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!