Facing issue with Camera in Xamarin iOS

Abhay Chavan 26 Reputation points
2022-03-10T04:50:32.773+00:00

await MediaPicker.CapturePhotoAsync();

This method throws an exception like the Specified method is not supported.

So unable to launch camera due to this problem.

please provide any updates on this issue.

Developer technologies .NET Xamarin
0 comments No comments
{count} vote

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-03-10T09:41:19.103+00:00

    Hello @Abhay Chavan ,

    Capturing a photo is not supported on iOS simulator, if you run your app on simulator, it will throw this exception. It's the limitation of Apple. You could debug the app on your iOS device for testing. It also needs some permissions, check the following keys in your Info.plist:

    <key>NSCameraUsageDescription</key>  
    <string>This app needs access to the camera to take photos.</string>  
    <key>NSMicrophoneUsageDescription</key>  
    <string>This app needs access to microphone for taking videos.</string>  
    <key>NSPhotoLibraryAddUsageDescription</key>  
    <string>This app needs access to the photo gallery for picking photos and videos.</string>  
    <key>NSPhotoLibraryUsageDescription</key>  
    <string>This app needs access to photos gallery for picking photos and videos.</string>  
    

    For more details, refer to https://learn.microsoft.com/en-us/xamarin/essentials/media-picker?tabs=ios

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.