Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone: Adding UIRequiredDeviceCapabilitie

Tags:

iphone

I am reading the "Device Support - Setting Required Hardware Capabilities" on http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedFeatures/AdvancedFeatures.html

I want to add still-camera capability by doing the following:

  1. Open my Info.plist
  2. Click +
  3. Add UIRequiredDeviceCapabilities on the Key column
  4. Add still-camera on the Value column
  5. Save the updated Info.plist

Is this the correct way?

Thanks in advance for your help.

like image 292
pion Avatar asked May 06 '26 05:05

pion


2 Answers

If you only want to have the capability to utilize the still camera, you don't have to do anything, except check that the camera exists at runtime:

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
  //Something
}

This is the correct approach, if your application has utility, even when run on a device without a camera. If, on the other hand, your App needs the camera in order to function, then changing the plist is the correct approach, as this is a signal to Apple that your App can not be used on a device without a camera. In that case the procedure you outlined is correct.

like image 75
Brad The App Guy Avatar answered May 08 '26 19:05

Brad The App Guy


Someone at the Developer Forum answered my question.

At the Raw Values/Keys mode

  • Click + sign to add a row
  • Enter UIRequiredDeviceCapabilities
  • XCode recognizes the key and automatically creates an item 0

At the "friendly" (Uncheck Raw Values/Keys) mode

  • Type "Required device capabilities"
  • XCode recognizes it and will auto-complete it
like image 34
pion Avatar answered May 08 '26 19:05

pion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!