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.02k stars 840 forks source link

IOS Permission.camera.request() not work #282

Closed Matrix-Zhang closed 4 years ago

Matrix-Zhang commented 4 years ago

🐛 Bug Report

Permission.camera.request() not work,nothing happened...

Configuration

Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'

      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

Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>TW Wallet</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSCameraUsageDescription</key>
    <string>Can we access your camera in order to scan barcodes?</string>
    <key>io.flutter.embedded_views_preview</key>
    <true/>
    <!-- Permission options for the `camera` group -->
    <key>NSCameraUsageDescription</key>
    <string>camera</string>
</dict>
</plist>

image

tap on 授权, nothing happened

Version: 5.0.0+hotfix.5

Platform:

Matrix-Zhang commented 4 years ago

the ios simulator is ok,.,,

Matrix-Zhang commented 4 years ago

my fault

mvanbeusekom commented 4 years ago

Thanks for letting us know