【问题标题】:How to change "Camera and Photo Library Permission" description?如何更改“相机和照片库权限”描述?
【发布时间】:2019-09-22 18:12:03
【问题描述】:

我已经在 NSCameraUsageDescription 和 NSPhotoLibraryUsageDescription 字段的 info.plist 文件中指定了我需要的文本,但没有任何改变。

始终使用相同的系统文本“此应用需要访问相机”和“此应用需要访问照片库”。我已经尝试在代码中找到它。没找到。我在文件 info.plist 中指定在我使用的所有库中添加我的 NSCameraUsageDescription 和 NSPhotoLibraryUsageDescription 键。同样没有任何变化。

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>CFBundleDisplayName</key>
    <string>Mona</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>$(PRODUCT_NAME)</string>
    <key>NSCameraUsageDescription</key>
    <string>The program wants to access the camera so you can use your photos and camera in this photo editor.</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>The program wants to access the photo gallery so you can use your photos and camera in this photo editor.</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <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/>
</dict>
</plist>

提醒图片

请帮助我。告诉我如何更改这些查询的描述。

【问题讨论】:

  • 请发布您的应用目标的 info.plist。
  • @shallowThought 完成
  • 不能替换系统文本,只能添加。显示您的权限警报的屏幕截图。
  • @Gereon 完成外观
  • 这绝对不是系统文本。字符串“此应用程序需要访问相机”必须在您的项目中,可能是本地化/字符串文件。

标签: ios


【解决方案1】:

该字符串存在于您正在使用的Gallery lib 的示例项目中。

   grep -r requires .

返回:

./Gallery-2.2.0/Example/GalleryDemo/GalleryDemo/Info.plist:     <string>This app requires access to camera</string>
./Gallery-2.2.0/Example/GalleryDemo/GalleryDemo/Info.plist:     <string>This app requires access to photo library</string>

这可能有几个原因:

  1. 错误的列表

您确实使用您发布的.plist,而是使用上面的那个

  1. Xcode 缓存

您正在使用与运行库示例代码相同的包 ID。确保不使用缓存:

  • 关闭 Xcode
  • 从设备/模拟器中删除应用
  • 清理派生数据
  • 打开 Xcode,构建并运行

【讨论】:

  • @Ivan Koval:那是什么? 1 还是 2?
  • 原来文件之间左边的info.plist与TARGETS属性中Info选项卡中的info.plist完全不同。
猜你喜欢
  • 1970-01-01
  • 2021-03-06
  • 2020-02-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-05
  • 1970-01-01
相关资源
最近更新 更多