flutter permission_handler调用iOS相

2022-09-02  本文已影响0人  从容到没边的优雅

按官网教程配置好后,还是不行。
参考转载来源。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

上一篇下一篇

猜你喜欢

热点阅读