有没有一种简单的方法可以找到在flutter中使用权限的包?Info.plist提交问题中缺少目的字符串
在向 Apple 提交应用程序期间,我收到了以下 ITMS-90683:Info.plist 中缺少目的字符串的通知。
NSBluetoothPeripheralUsageDescription
NSBluetoothAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
以前问题与permission_handler 包有关,但使用文档中提供的脚本,可以有效地排除包接触但应用程序未使用的权限。在更新了所有依赖项并添加了许多其他依赖项后,我发现自己被提示输入其他三个我实际上并不打算使用的权限。有没有一种快速的方法来找到这些包中的哪一个去使用?如果不知道哪个包可能需要这些权限?
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
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: 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-permission-handler