首先,我想说我已经看过Stack Overflow post here了,并且加上iCoder和Deepak提到的那一项并不能解决我的问题。
我正在使用React-Native开发我的应用程序,包括我发现的这个React-Native-Permissions包。他们的文档指出,我应该添加其软件包启用的所有权限,例如位置,相机和此处提到的所有其他位置。完成此操作后,我可以将我的应用程序上载到商店并提交以供审核。
今天我去办公室了,发现苹果提供了一些反馈。因此,在完成反馈后,我想再次重新上传到商店(如我应该做的那样增加内部版本号)。
现在,当我像这样在info.plist中显示消息时,我会不断收到上述标题中的消息
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library, which references this permission in its code.</string>
编辑:
我希望在下面阐明一些内容,以便找到我所面临的问题的答案。标题中给出的错误是在上载到商店后直接发生的(因此,我猜测实际的错误是由系统自动检查的)。
下面的答案将无法帮助我解决问题,因为更具描述性的字符串不会由自动系统检查进行检查。而且我已成功将此字符串用于info.plist中的其他元素。在此之后,我发现了证据,表明人们已经使用此策略成功将其应用程序提交到应用程序商店。如该链接React Native Permission issue 266
上Gradner的评论所示答案 0 :(得分:15)
只需将其添加到您的Info.plist文件中即可:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library, which references this permission in its code.</string>
Apple不赞成使用NSBluetoothPeripheralUsageDescription属性,而推荐使用NSBluetoothAlwaysUsageDescription。
在此处查看详细信息: link to Apple docs
只需将其添加到您的Info.plist文件中即可:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Our app uses bluetooth to find, connect and transfer data between different devices</string>
答案 1 :(得分:7)
有人发布了对我有帮助的答案,但随后将其删除!解释一下答案:
将隐私密钥添加到plist而不知道是什么原因导致了Apple的错误不是解决此问题的最佳方法。
就我而言,当我执行grep搜索时,发现CoreBluetooth.framework
中有对project.pbxproj
的引用。我删除了参考,构建和TestFlight上传成功!
要搜索,请使用以下命令:
grep -r -a CoreBluetooth.framework ProjectFolder
答案 2 :(得分:3)
我找到了根本原因
我们在plist中有以下两个默认选项可以输入蓝牙使用情况。
1。隐私-蓝牙外围设备使用说明 2.隐私-蓝牙始终使用说明
但是Xcode将此选项保存在如下所示的源代码中
1.NSBluetoothPeripheralUsageDescription代替隐私-蓝牙外围设备使用说明
2。隐私-蓝牙始终使用说明而不是隐私-蓝牙始终使用说明
所以现在的重点是 NSBluetoothPeripheralUsageDescription已过时,并且期望键为“ NSBluetoothAlwaysUsageDescription”
这是解决方案,在Xcode中打开plist文件作为源代码,然后 复制并粘贴下面的键值对
键:NSBluetoothAlwaysUsageDescription值:此应用程序 需要蓝牙才能bla bla bla。
答案 3 :(得分:2)
我不知道为什么它第一次无法正常工作,但是今天当我走进办公室时,我看到了Sumeet.Jain的评论,建议我更换
带有NSBluetoothAlwaysUsageDescription键的NSBluetoothPeripheralUsageDescription键
这实际上将导致错误,如我们所期望的那样,缺少NSBluetoothPeripheralUsageDescription。因此,然后我将NSBluetoothPeripheralUsageDescription重新添加到了info.plist中,现在终于可以将我的应用程序上载到商店了。谢谢大家的帮助。
p.s。我唯一能想到的与昨天相比有所不同的是,我现在使用Xcode添加了密钥,而不仅仅是在我用于react-native的编辑器中编辑info.plist文件。希望这对其他人有所帮助
答案 4 :(得分:2)
好,我解决了这个问题。
如果您的应用程序正在使用蓝牙,则必须将其添加到info.plist。
NSBluetoothAlwaysUsageDescription
我们的应用程序使用蓝牙...做某事...
如果您的应用不需要蓝牙,但会意外提示。
然后:
打开Xcode: 去删除CoreBluetooth.framework:
对我有用! 希望能为您提供帮助。
答案 5 :(得分:0)
打开应用程序后,我能够成功删除Bluetooth权限警报。在我的情况下,问题出在“ react-native-connectivity-status”库中。我将该库从版本“ 1.5.2”降级为“ 1.5.1”。
以下是步骤:
更改
"react-native-connectivity-status": "^1.5.1",
收件人
"react-native-connectivity-status": "1.5.1",
然后运行以下命令:
rm -rf node_modules/
rm package-lock.json
npm i
cd ios/
rm -rf Pods/
pod install
答案 6 :(得分:0)
对于早于 iOS 13 的部署目标,将 NSBluetoothAlwaysUsageDescription 和 NSBluetoothPeripheralUsageDescription 添加到您应用的信息属性列表文件中
字符串取决于您是否使用蓝牙。
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes some library, which references this permission in its code.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes some library, which references this permission in its code.</string>