Firelands128 / photo_gallery

A Flutter plugin that retrieves images and videos from mobile native gallery.
BSD 3-Clause "New" or "Revised" License
68 stars 62 forks source link

listAlbums returns empty #37

Open duzenko opened 3 years ago

duzenko commented 3 years ago
    videoAlbums = await PhotoGallery.listAlbums(mediumType: MediumType.video);

returns one album with 0 length even though there are videos on device

Firelands128 commented 3 years ago

Please provide more info to reproduce this issue.

duzenko commented 3 years ago

I think it might have something to do with permissions The photo_manager plugin I used instead of yours shows the permission request properly and works afterwards

unclemeric commented 1 year ago

修改Podfile文件: post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target)

添加以下代码可解决问题

target.build_configurations.each do |config|
  config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
    '$(inherited)',
    ## dart: PermissionGroup.camera
    'PERMISSION_CAMERA=1',
    # dart: PermissionGroup. photos
    'PERMISSION_PHOTOS=1',
    'PERMISSION_PHOTOS_ADD_ONLY=1',
    # dart: [PermissionGroup. location, PermissionGroup. locationAlways, PermissionGroup. locationWhenInUse]
    # 'PERMISSION_LOCATION=1',
    # dart: PermissionGroup.mediaLibrary
    'PERMISSION MEDIA LIBRARY=1'
  ]
end

end end