gpt4 book ai didi

ios - Cordova Info.plist NSCameraUsageDescription 键丢失

转载 作者:IT王子 更新时间:2023-10-29 07:55:31 25 4
gpt4 key购买 nike

经过最近的更改后,如果您的应用程序试图访问隐私敏感数据,Apple 需要特定的 key 。所以我在我的 config.xml 中添加了 NSCameraUsageDescription 键,如下所示:

<platform name="ios">
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
<string>We are using a camera to </string>
</config-file>
</platform>

然后

cordova build ios --release --device

生成的 ipa 显然在 info.plist 中没有正确的信息。感觉好像错过了什么。

问题 1:我需要在 config.xml 中添加什么来解决 NSCameraUsageDescription 问题?问题 2:是否可以对该字符串使用本地化?

谢谢!

最佳答案

新答案:

从 Cordova CLI 6.5.0 开始,您可以使用 config.xml 中的 edit-config 标签直接写入 info.plist > 像这样:

    <string>your usage message</string>
</edit-config>

但请确保您使用的是最新版本的插件,否则值可能会被插件变量覆盖。

对于本地化,您可以使用 resource-file 标签和 InfoPlist.strings 文件,就像在这个插件中一样(但您不需要插件,config.xml 支持 resource-file 标签)

https://github.com/MBuchalik/cordova-plugin-ios-permissions


旧答案:

您还不能使用 config-file 标签在 config.xmlinfo.plist 上写入 (正在进行中)

最新版本的相机插件允许您在安装插件时添加NSCameraUsageDescription

cordova 插件添加 cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="您的使用信息"

目前无法本地化此字符串

关于ios - Cordova Info.plist NSCameraUsageDescription 键丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39566952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com