Camera problem on iOS 10 (iPad)

Hi All,

I am facing a problem when trying to start camera app from Xamarin.iOS application.

The following code is used for opening the camera app. It worked on all previous iOS versions, without any problems.
<br /> mediaPickerController = mediaPicker.GetTakePhotoUI(new StoreCameraMediaOptions<br /> {<br /> Name = "filename",<br /> Directory = "dirname",<br /> });<br /> this.PresentViewController(mediaPickerController, true, null);<br /> mediaPickerController.GetResultAsync().ContinueWith(t =><br /> {<br /> //do something<br /> });<br />

What I have experienced on iOS 10 is that this code gets executed properly, without exceptions, chrashes, etc., but camera doesn't get opened.
I've started Camera app manually, and verified that it works.

Has anyone had the same or similar problems? What could be wrong? Is it something iOS 10 specific, or combination Xamarin-iOS10 is causing that?

All suggestions are welcome.

Answers

  • We've been seeing crashing problems in IOS with the camera using MediaPicker. Have you been able to resolve this at all?

  • You need to put the NSCameraUsageDescription key in your Info.plist

    Source: stackoverflow.com/a/38650785/370307

  • In my code, which looks practically the same, the PresentViewController call triggers a call to GetSupportedInterfaceOrientations in my RootController and the VisibleViewController is null, causing a null exception. Adding the privacy permissions worked last night and this morning it's broke again in exactly the same way, despite the privacy permissions working last night. I've never been at such a loss before :neutral:

  • @MatthewFerrin said:
    In my code, which looks practically the same, the PresentViewController call triggers a call to GetSupportedInterfaceOrientations in my RootController and the VisibleViewController is null, causing a null exception. Adding the privacy permissions worked last night and this morning it's broke again in exactly the same way, despite the privacy permissions working last night. I've never been at such a loss before :neutral:

    Fixed my problem by simply returning UIInterfaceOrientationMask.All from GetSupportedInterfaceOrientations since you can't call GetSupportedInterfaceOrientations on a null controller.

  • JanFrostJanFrost DEMember ✭✭
    edited November 9

    @AlexandrePepin.4826 said:
    You need to put the NSCameraUsageDescription key in your Info.plist

    Source: stackoverflow.com/a/38650785/370307

    Thanks that solved my problem.

Sign In or Register to comment.