Forum Xamarin.iOS

Camera permission doesn't work

I have a webview wich displays my website. On my website I have a button that has should open a dialog that shows the user to choose between opening the camera of pick a file(Same goes for recording a video).

But when I click on the button nothing happens. I have the permissions in my info.plist but when I run the emulator it does not even ask for my permissions to use camera and library etc.

How can solve this?


  • LandLuLandLu Member, Xamarin Team Xamurai

    Have you tested it on a real physical device?
    Camera features are not available on emulators so the application will crash before the permission dialog showing up.

  • DiederiknDiederikn Member ✭✭


    Thank you for you reaction. I have tested the app on a real device. I can take a picture with camera. But when I click on a button to record a video the app crashes. Also the user has to be able to choose between taking a picture/ recording video and picking a file.

    Do you have any idea to solve this?

    I am looking forward to your response

  • LandLuLandLu Member, Xamarin Team Xamurai

    If you are using the native UIImagePickerController and want only to take videos we could set the MediaTypes like:

    imgPicker.MediaTypes = new string[] { UTType.Movie };

    But when I click on a button to record a video the app crashes

    This could be caused by the code after taking the videos. It's best to share your sample to help us reproduce this issue.

  • DiederiknDiederikn Member ✭✭


    We are able to take video now because we were lacking a permission. Apparently is was called microphone permission in the info.plist

    When we press our file upload button we want to see a dialog that lets you choose between taking picture or selecting picture from the gallery:

    asp:FileUpload ID="FileUploadPlayerVideo" runat="server" renderid="true" accept="image/*" capture="camera" type="file"/

    At the moment we have not inplemented UIImagePickerController in the iOS application. Because we dont understand how to implement this object.

    Here is our appdelegate:

    We would like to know how to solve this problem.

Sign In or Register to comment.