Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone etc: how to tell if the device has a camera?

Tags:

iphone

Version 3.1.3 if its relevant.

There is this suggestion which may work now, but in the future?

NSString *device = [UIDevice currentDevice].model;

if([device isEqualToString:@"iPhone"])
like image 219
Jim Blackler Avatar asked Jul 01 '10 11:07

Jim Blackler


People also ask

Can I find a hidden camera with my iPhone?

Search for Infrared Lights Using Your iPhone's Camera Certain spy cameras rely on infrared lights, which are normally invisible to the human eye. However, the camera on your iPhone can detect this. In order to be sure, point the camera at a known source of infrared light – a TV remote is one.

Can someone be watching me on my iPhone?

If your iPhone backs everything up to your iCloud account, then someone can spy on your activity by accessing your iCloud account from any web browser. They would need your Apple ID username and password in order to do this, so if you know that a third party has that information, there are a few steps you should take.

How do I know what camera my iPhone has?

Open the Photos app on your ‌iPhone‌ and select a picture with a clearly defined subject, such as a flower or animal. Check the info ("i") icon at the bottom of the screen. If it has a little star over it, tap it – this indicates there's a Visual Lookup you can examine.

How do I enable my camera on my iPhone?

Click Settings, the app name, Privacy, Enable the camera, then close the app and try again.


1 Answers

#define SOURCETYPE UIImagePickerControllerSourceTypeCamera

// does the device have a camera?
if ([UIImagePickerController isSourceTypeAvailable:SOURCETYPE]) {
  // if so, does that camera support video?
  NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:SOURCETYPE];
  bool isA3GS = [mediaTypes containsObject:(NSString*)kUTTypeMovie];
}
like image 65
Tom Gullen Avatar answered Oct 06 '22 05:10

Tom Gullen