xcode 应用程序被拒绝:缺少 Info.plist 键“NSBluetoothPeripheralUsageDescription”但框架不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44003952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:58:47  来源:igfitidea点击:

App rejected: Missing Info.plist key "NSBluetoothPeripheralUsageDescription" but framework is not present

iosxcodecordova

提问by Bruno Peres

I have a Cordova app that runs in iOS phones. I'm trying to send an update of this app to App Store, but it is being rejected. Firstly it was rejected because the info.plistcontained a line with the key NSBluetoothPeripheralUsageDescriptionand this feature is never used in my app. To solve this problem I removed this line from info.plistand the respective framework from Linked Frameworks and Libraries in xCode (the framework CoreBluetooth.frameworkand the line NSBluetoothPeripheralUsageDescriptionwas added by Cordova Diagnostic Plugin), as can be seen in the image below: Linked Frameworks and Libraries

我有一个在 iOS 手机中运行的 Cordova 应用程序。我正在尝试将此应用程序的更新发送到 App Store,但被拒绝。首先,它被拒绝了,因为它info.plist包含一行带有密钥的行,NSBluetoothPeripheralUsageDescription并且我的应用程序中从未使用过此功能。为了解决这个问题,我从info.plistxCode 中的链接框架和库中删除了这一行和相应的框架(该框架CoreBluetooth.framework和该行NSBluetoothPeripheralUsageDescription是由Cordova 诊断插件添加的),如下图所示: 链接的框架和库

However now I'm receiving a e-mail from iTunes Connect saying this:

但是现在我收到一封来自 iTunes Connect 的电子邮件,内容如下:

Missing Info.plist key- This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

缺少 Info.plist 键- 此应用程序尝试访问隐私敏感数据而没有使用说明。应用程序的 Info.plist 必须包含一个 NSBluetoothPeripheralUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。

But I removed the CoreBluetooth.frameworkfrom the xCode project...

但是我CoreBluetooth.framework从 xCode 项目中删除了...

My question is:I need to remove this framework from another place? Are some other framework able to use bluetooth causing this problem?

我的问题是:我需要从另一个地方删除这个框架吗?是否有其他框架能够使用蓝牙导致此问题?

Thanks for help.

感谢帮助。

回答by Silversky Technology

Open Info Plist file and press on + sign add new key in info.plist of your project and add this NSBluetoothPeripheralUsageDescriptionand write value "Explain the reasons for bluetooth"

打开 Info Plist 文件并按 + 符号在项目的 info.plist 中添加新密钥并添加此 NSBluetoothPeripheralUsageDescription并写入值“解释蓝牙的原因”

Check Screen shot below enter image description here

检查下面的屏幕截图 在此处输入图片说明

回答by D. Rothschild

It appears that you cannot have a generic text string like:

看来你不能有一个通用的文本字符串,如:

We need access to your bluetooth connection.

我们需要访问您的蓝牙连接。

I had something like this and got rejected. When I had a more detailed description like:

我有这样的事情并被拒绝了。当我有更详细的描述时:

We need access to your bluetooth connection to upload data from your device for crash reports.

我们需要访问您的蓝牙连接才能从您的设备上传数据以获取崩溃报告。

I was approved.

我被批准了。

回答by Pankaj Teckchandani

The descriptions are mandatory for any content you or any frameworks you link against attempt to access. The errors are generated upon an attempt to access the content if a usage description was not supplied, so if you're getting those errors your app must be requesting them. You should discover why your app or its frameworks require these and add appropriate usage descriptions to your app's info.plist.

对于您或您链接的任何框架尝试访问的任何内容,这些描述都是强制性的。如果未提供使用说明,则会在尝试访问内容时生成错误,因此如果您收到这些错误,您的应用程序必须请求它们。您应该了解为什么您的应用或其框架需要这些,并将适当的使用说明添加到您的应用的 info.plist。

Or more ideally, if you don't need access, see if there's a way to not request it (or use frameworks that do unnecessarily).

或者更理想的是,如果您不需要访问权限,请查看是否有办法不请求它(或使用不必要的框架)。

For time being you can add the following descriptions in your info.plist and submit your app (in case of urgent app update)

暂时你可以在你的 info.plist 中添加以下描述并提交你的应用程序(在紧急应用程序更新的情况下)

<key>NSCalendarsUsageDescription</key>
    <string>Explain the reasons for accessing...</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Explain the reasons for accessing...</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>Explain the reasons for accessing...</string>

Just open your info.plist and add the code above accordingly.

只需打开您的 info.plist 并相应地添加上面的代码。

enter image description here

在此处输入图片说明

回答by Zgpeace

Try to add below in your plist. It solve my problem.

尝试在您的 plist 中添加以下内容。它解决了我的问题。

<config-file parent="NSPhotoLibraryUsageDescription" platform="ios" target="*-Info.plist">
        <string>YourAppName would like to store a photo.</string>
    </config-file>