0

Is it possible to check the status for Camera permission under privacy settings within the app and present a alert view informing the user that camera permission must be enabled for the app to function? This has to do with opening the app for the first time and the user denying camera access. Is there a better way to inform the user that permission must be granted for the camera to function properly? Also, I need to check for permission for photos access.

iamarnold
  • 229
  • 3
  • 12
  • Does this also apply for other permissions? Like access to photos, bluetooth sharing, calendars, etc... I need to also check for permission for photos. – iamarnold Feb 04 '15 at 21:02
  • you didn't mentioned that in your question. There are similar methods available for all those. – Midhun MP Feb 04 '15 at 21:06

1 Answers1

0
UIImagePickerController *cameraPicker = [[UIImagePickerController alloc] init];

cameraPicker.delegate = self;

cameraPicker.allowsEditing = NO;

if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

{//then show alert here}

If you want to check the library, use the same isSourceTypeAvailable method above and use the value UIImagePickerControllerSourceTypePhotoLibrary.

Coach
  • 309
  • 1
  • 4
  • 14
  • 1
    He is asking about camera permission, not library available check. – Midhun MP Feb 04 '15 at 20:34
  • @MidhunMP Does the duplicate you gave also apply for other permissions? Like access to photos, bluetooth sharing, calendars, etc... I need to also check for permission for photos. – iamarnold Feb 04 '15 at 21:03
  • @iamarnold: You didn't mentioned these cases in your question, did you ? In question you only mentioned about camera. So it's a duplicate. If all above mentioned was in your question, it won't be a duplicate. – Midhun MP Feb 04 '15 at 21:08
  • @MidhunMP Ok, it's duplicate, but thats not the point of my question. Question has be edited. I'm asking if there's another way to check for permissions other than camera like permission for photos. – iamarnold Feb 04 '15 at 21:36
  • @iamarnold: You can check photo permission also using ALAsset Library or photo framework (http://stackoverflow.com/questions/14394886/user-permission-before-accessing-iphone-data) – Midhun MP Feb 04 '15 at 22:02