Jayshree
Jayshree

Reputation: 281

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

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?

Upvotes: 0

Views: 919

Answers (2)

Nik Burns
Nik Burns

Reputation: 3423

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?

Upvotes: 1

Andrey Zverev
Andrey Zverev

Reputation: 4418

Try using canOpenUrl method with FaceTime scheme, as follows:

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

Upvotes: 3

Related Questions