gpt4 book ai didi

ios - 如何通过 config.xml 将 NSPhotoLibraryUsageDescription 添加到 plist 文件?

转载 作者:行者123 更新时间:2023-11-29 11:31:43 48 4
gpt4 key购买 nike

我正在开发一个新应用程序,并尝试通过应用程序加载器首次提交到 iTunes。 ipa 文件由 phonegap 构建在线服务构建,该应用程序使用 cordova 相机插件等。

当我使用应用程序加载器上传 ipa 文件时,一切似乎都成功了,但几分钟后我收到一封电子邮件,内容如下:

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSPhotoLibraryUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

以及与 NSCameraUsageDescription 相关的类似段落

我已经尝试了很多在网上找到的修复方法,包括将以下任何和所有内容添加到 config.xml 中:

 <platform name="ios">
.....
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>

</platform>
<gap:config-file platform="ios" parent="NSCameraUsageDescription">
<string>For taking pictures</string>
</gap:config-file>
<gap:config-file platform="ios" parent="NSPhotoLibraryUsageDescription">
<string>For uploading images</string>
</gap:config-file>
<plugin name="cordova-plugin-camera" spec="^4.0.3" >
<variable name="NSCameraUsageDescription" value="Take pictures of stuff" />
<variable name="NSPhotoLibraryAddUsageDescription" value="App would like to access the library." />
</plugin>

取自官方插件文档以及 stackoverflow 上的其他几个问题,但每次提交都会返回相同的电子邮件。我似乎无法弄清楚要添加到 config.xml 文件的正确行是什么。

最佳答案

想通了。 phonegap 构建服务默认使用 cli-6.5.0,这意味着您需要将以下内容添加到 widget 标签内的 config.xml 而不是平台标签内。

<config-file platform="ios" parent="NSCameraUsageDescription" mode="replace">
<string>App would like to access the camera.</string>
</config-file>

<config-file platform="ios" parent="NSPhotoLibraryUsageDescription" mode="replace">
<string>App would like to access the camera.</string>
</config-file>

取自http://docs.phonegap.com/phonegap-build/configuring/config-file-element/

关于ios - 如何通过 config.xml 将 NSPhotoLibraryUsageDescription 添加到 plist 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52835814/

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