Skip to content

iOS macro not working with new Flutter 1.20.0 Podfile #358

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
1 task
kuhnroyal opened this issue Aug 3, 2020 · 3 comments
Closed
1 task

iOS macro not working with new Flutter 1.20.0 Podfile #358

kuhnroyal opened this issue Aug 3, 2020 · 3 comments

Comments

@kuhnroyal
Copy link

kuhnroyal commented Aug 3, 2020

🐛 Bug Report

After upgrading to Flutter 1.20.0 beta a new Podfile needs to be generated (flutter/flutter#45197).
Afterwards I added the configuration to the Podfile but it is not taking effect.
I ran flutter clean without any effect, something must have changed in the targets.

I can request all permissions, camera etc. which means the macros are not working.

Expected behavior

Only location permission should be available.

Reproduction steps

  • Update to Flutter 1.20.0 beta
  • Configure permissions for iOS and exclude camera
  • Try to use camera

Configuration

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    target.build_configurations.each do |config|

      # You can remove unused permissions here
      # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/permission_handler/ios/Classes/PermissionHandlerEnums.h
      # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',

        ## dart: PermissionGroup.calendar
        'PERMISSION_EVENTS=0',

        ## dart: PermissionGroup.reminders
        'PERMISSION_REMINDERS=0',

        ## dart: PermissionGroup.contacts
        'PERMISSION_CONTACTS=0',

        ## dart: PermissionGroup.camera
        'PERMISSION_CAMERA=0',

        ## dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=0',

        ## dart: PermissionGroup.speech
        'PERMISSION_SPEECH_RECOGNIZER=0',

        ## dart: PermissionGroup.photos
        'PERMISSION_PHOTOS=0',

        ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
        # 'PERMISSION_LOCATION=0',

        ## dart: PermissionGroup.notification
        'PERMISSION_NOTIFICATIONS=0',

        ## dart: PermissionGroup.mediaLibrary
        'PERMISSION_MEDIA_LIBRARY=0',

        ## dart: PermissionGroup.sensors
        'PERMISSION_SENSORS=0'
      ]
    end
  end
end

Version: 5.0.1

Platform:

  • [x ] 📱 iOS
  • 🤖 Android
@kuhnroyal
Copy link
Author

Nevermind that was my stupidity. The camera plugin does not use the permission handler so my test was bogus.

@febg11
Copy link

febg11 commented Aug 3, 2020

Have you gotten this to work? My app seems to be always be requesting location despite it not being commented out

@kuhnroyal
Copy link
Author

You probably have another plugin that is requesting the permission. Like geolocator or something.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants