有没有一种简单的方法可以找到在 flutter 中使用权限的包?Info.plist 提交问题中缺少目的字符串 [英] Is there an easy way to find packages that use permissions in flutter? Missing Purpose String in Info.plist submission problem

查看:27
本文介绍了有没有一种简单的方法可以找到在 flutter 中使用权限的包?Info.plist 提交问题中缺少目的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在向 Apple 提交应用程序期间,我收到了以下 ITMS-90683:Info.plist 中缺少目的字符串的通知.

During the submission to Apple of the application I was notified of the following ITMS-90683: Missing Purpose String in Info.plist.

NSBluetoothPeripheralUsageDescription
NSBluetoothAlwaysUsageDescription
NSLocationWhenInUseUsageDescription 

以前的问题与permission_handler 包有关,但是使用文档中提供的脚本可以有效地排除包接触但应用程序未使用的权限.在更新了所有依赖项并添加了许多其他依赖项后,我发现自己被提示输入其他三个我实际上并不打算使用的权限.有没有一种快速的方法来找到这些包中的哪一个去使用?如果不知道哪个包可能需要这些权限?

Previously the problem was related to the permission_handler package but with a script that is provided in the documentation it was possible to effectively exclude the permissions that the package touches but are not used by the application. After updating all the dependencies and adding many others, I find myself prompted to enter these other three permissions that I'm not really going to use. Is there a quick way to find which of these packages go to use? If there is no idea which package might require these permissions?

  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  flutter_spinkit: ^5.0.0
  shared_preferences: ^2.0.4
  cached_network_image: 2.5.1
  cached_video_player: ^1.0.3
  rxdart: ^0.25.0
  flutter_inappwebview: ^5.1.0+4
  sqflite: ^2.0.0+2
  path: ^1.8.0
  pull_to_refresh: ^1.6.4
  font_awesome_flutter: ^8.12.0
  flutter_svg: ^0.19.3
  purchases_flutter: ^3.1.0
  url_launcher: ^6.0.2
  rflutter_alert: ^2.0.2
  modal_progress_hud: ^0.1.3
  sizer: ^1.1.8
  permission_handler: ^6.1.0
  image_gallery_saver: ^1.6.8
  http: ^0.13.0
  path_provider: ^2.0.1
  onesignal_flutter: ^3.0.0-beta1
  google_mobile_ads: ^0.11.0+3
  #Firebase dependencies
  firebase_core: ^1.0.1
  firebase_auth: ^1.0.1
  cloud_firestore: ^1.0.1
  firebase_crashlytics: ^1.0.0
  firebase_analytics: ^7.1.1 

我不想为我不打算使用的权限添加理由.谢谢

I don't want to add justification for permissions that I'm not going to use. Thank you

编辑 1:我附上了permission_handler 请求的Podfile 部分.如自述文件所示,我的应用实际使用的权限已被注释(照片和通知)

EDIT 1: I am attaching the section of the Podfile that is requested by permission_handler. as indicated in the readme, the permissions that are actually used by my app have been commented (PHOTOS and NOTIFICATIONS)

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['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'

    # 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.photos
      # 'PERMISSION_PHOTOS=0',

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

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

      ## 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.mediaLibrary
      'PERMISSION_MEDIA_LIBRARY=0',

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

EDIT 2:蓝牙权限是否可能是新的 Flutter 2.0.2 版的错误?Flutter 在调试模式下,在 iOS 应用程序第一次启动时,它总是要求获得检测附近设备的权限(即使在我之前使用的 1.22 版本中)

EDIT 2: Is it possible that the bluetooth permissions is a bug of the new flutter version 2.0.2? Flutter in debug mode, at the first launch of the iOS app, it always asked for permissions to detect nearby devices (even in the version I was using previously 1.22)

推荐答案

尝试

## dart: PermissionGroup.bluetooth
'PERMISSION_BLUETOOTH=0'

最近添加到permission_handler GitHub 文档:https://github.com/Baseflow/flutter-权限处理程序

It was added recently to permission_handler GitHub documentation: https://github.com/Baseflow/flutter-permission-handler

这篇关于有没有一种简单的方法可以找到在 flutter 中使用权限的包?Info.plist 提交问题中缺少目的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆