SajithK
SajithK

Reputation: 852

Flutter ImageCrop library camera permission error in iOS version

I'm trying to use ImageCrop library to crop image in a Flutter app. In this library we can ask user to grant permission to access camera by

final permissionsGranted = await ImageCrop.requestPermissions();

This works well in android and present permission dialog in android but it is not working in iOS. Anyone know a solution for this?

Upvotes: 0

Views: 3491

Answers (3)

SajithK
SajithK

Reputation: 852

@Darshan Patel's answer is the correct one. I'm adding few screenshots if anyone face the same problem and worrying how to add those permissions when using Android Studio.

enter image description here

Open info.plist in Runner package. Add followings inside tag.

<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs to access photo library</string>
<key>NSCameraUsageDescription</key>
<string>This app needs Camera Usage</string>

Upvotes: 0

Darshan Kunjadiya
Darshan Kunjadiya

Reputation: 908

Can you try by adding below permissions in .plist file in XCode.

<key>NSCameraUsageDescription</key>
<string>camera description.</string>

<key>NSPhotoLibraryUsageDescription</key>
<string> photos description.</string>

Hope this work for you.

Upvotes: 5

GirlWhoCode
GirlWhoCode

Reputation: 628

i think if you want to get permission try to add permissionhandler package , and use it:

await PermissionHandler().requestPermissions([PermissionGroup.camera]) ; 

Upvotes: 0

Related Questions