skip to Main Content

I’ve an issue that is unusual. When I test my app with XCode evertything is working on my iphone and the other iphones, the app asks to user for all permissions. But when I added my app to TestFlight, the app does not ask camera and microphone permissions to user? "Privacy – Camera Usage Description" and "Privacy – Photo Library Usage Description" keys are already added to info.plist file. The app behaves different on TestFlight, how can it be?

3

Answers


  1. If the user has previously denied the use of the camera, then the status will be AVAuthorizationStatusDenied and the dialog will not be displayed when asking for permissions.

    Login or Signup to reply.
  2. To make sure your app has permission before capturing media, follow the steps below.

    Configure Your App’s Info.plist File

    iOS requires that your app provide static messages to display to the user when the system asks for camera or microphone permission:

    • If your app uses device cameras, include the Privacy – Camera Usage
      Description key in your app’s Info.plist file.
    • If your app uses device photo library, include the Privacy – Photo
      Library Usage Description key in your app’s Info.plist file

    Verify and Request Authorization for Capture

    You can add below code in AppDelegate main file OR while click on capture media to request access authorization.

    import AVFoundation
    
    AVCaptureDevice.requestAccess(for: .video) { granted in
    
                if granted {
                // Setup your code.
                }
            }
    

    Apple Ref Link https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_ios

    Login or Signup to reply.
  3. Actually, we faced with the similar issue recently. In our case, the solution was related to signing.

    If you’re checked the automatically manage signing box in Xcode, you can try this to fix this issue:

    1. Create ‘Distribution’ certificate on Apple Developer Console.
    2. Create ‘App Store’ provisioning profile by selecting the created certificate in Step 1.
    3. Download certificate and add to your keychain.
    4. In Xcode update the release signing part with this newly created provisioning profile and certificate.

    By these steps we fixed our permission issue in TestFlight. I hope this post will help someone in someday.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search