Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7043 iOS 8 Support
  3. CB-7667

[Camera] iOS8: Handle case where camera is not authorized

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      In iOS 8, it's possible for the camera to be disabled for any given app; in iOS 7, this was only possible in certain regions (e.g. China).

      If the camera is disabled, and someone launches the Camera plugin to capture an image from the camera, they'll just get the camera UI with a black screen, and no indication that the camera permission is disabled for the app. A better UX would be to show the user a prompt indicating that the camera permission is disabled, and (on iOS 8) providing a button to take them to the Settings app to change it.

      As of iOS 7, there's a new API to test whether the app has access to capture the desired media type:

      https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/index.html#//apple_ref/occ/clm/AVCaptureDevice/authorizationStatusForMediaType:

      [AVCaptureDevice authorizationStatusForMediaType:mediaType];

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shazron Shazron Abdullah
            dpolivy Dan Polivy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment