问题
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