How to allow only iPhone 4 to use the application, since it uses the front camera

I was wondering as soon as the iPhone 4 can use my application that uses the front camera. Can I do it + (BOOL)isCameraDeviceAvailable:(UIImagePickerControllerCameraDevice) and how to implement it so that it throws some error if it returns no

or should I use NSString * DeviceType etc.

if iPhone 4 ... do nothing

if else ... Show warning?

How to implement this in my application?

TIA!

+3
source share
2 answers

front-facing-camera UIRequiredDeviceCapabilities Info.plist. , , App Store iPhone 4.

+9

applicationDidFinishLaunching:

if (![UIImagePickerController isCameraDeviceAvailable: UIImagePickerControllerCameraDeviceFront])
{
     [[[[UIAlertView alloc] initWithTitle: @"No Front Camera" 
                                  message: @"This app requires a front camera." 
                                 delegate: self 
                        cancelButtonTitle: @"Ok" 
                        otherButtonTitles: nil] autorelease] show];
}
+5

Source: https://habr.com/ru/post/1758486/


All Articles