美文网首页
flutter permission_handler

flutter permission_handler

作者: liboxiang | 来源:发表于2020-06-30 16:46 被阅读0次

如果iOS不做处理,会要求在info.plist文件中加入所有权限

解决方法

//#ifndef PERMISSION_PHOTOS
//    #define PERMISSION_PHOTOS 1
//#endif

另一种方法

# 以下是新增的,permission_handle中动态申请摄像头、麦克风权限
          # 权限列表参考:https://pub.flutter-io.cn/packages/permission_handler
          # "Add the following to your Podfile file" 一节

            # You can remove unused permissions here
            # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/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)',
             'PERMISSION_EVENTS=0',
             'PERMISSION_REMINDERS=0',
             'PERMISSION_MICROPHONE=0',
             'PERMISSION_SPEECH_RECOGNIZER=0',
             'PERMISSION_LOCATION=0',
             'PERMISSION_NOTIFICATIONS=0',
             'PERMISSION_MEDIA_LIBRARY=0',
             'PERMISSION_SENSORS=0',
            ]

相关文章

网友评论

      本文标题:flutter permission_handler

      本文链接:https://www.haomeiwen.com/subject/vmvxqktx.html