Baseflow / flutter-permission-handler

Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
https://baseflow.com
MIT License
2.05k stars 859 forks source link

Fix: Return correct permission status for Android's limited media access #1362

Closed VladShturma closed 3 months ago

VladShturma commented 3 months ago

This PR fixes the issue https://github.com/Baseflow/flutter-permission-handler/issues/1243

Before fix when selecting 'Selected Photos Access enabled' on Android 14 the code await Permission.photos.request(); returned PermissionStatus.denied. After fix it returns PermissionStatus.limited

Pre-launch Checklist

LulleBulle commented 3 months ago

nice job @VladShturma. I was looking at it the other day but did not understand why requestPermissions implementation was not enough and I had some issues locating the success callback but now saw that the comment above mentions onRequestPermissionsResult

LulleBulle commented 3 months ago

I have tried it in the examples app and I still get that it returns denied. image @VladShturma @mvanbeusekom

VladShturma commented 3 months ago

@LulleBulle are you using example app that is inside permission_handler_android directory? Because I also checked in example app and it returns limited image

LulleBulle commented 3 months ago

@LulleBulle are you using example app that is inside permission_handler_android directory? Because I also checked in example app and it returns limited image

Yes, I might have had some issues with gradle not compiling correctly and using an old version. Thanks for verifying for me :)