Search code examples
iosflutterxcodecocoapods

How to declare camera and gallery permission in flutter for iOS?


I use image picker and gallery saver in my project. But I don't know how to give permission for iOS I know how add permission in Android but I can't understand where I put permission and what permission I want for camera and gallery. I completed Android permission but I don't know how I put permission on iOS.


Solution

  • Open the Info.plist file in the ios/Runner folder of your Flutter project.

    Add the following keys to the Info.plist file:

    <dict>
        <!-- Other keys and configurations... -->
        
        <key>NSCameraUsageDescription</key>
        <string>Your app needs access to the camera to take photos and videos.</string>
        
        <key>NSPhotoLibraryUsageDescription</key>
        <string>Your app needs access to the photo library to select photos and videos.</string>
    </dict>