The app's Info.plist file should contain a NSB

2020-06-30 05:05发布

First of all, I would like to state that I already looked at Stack Overflow post here and adding either the one mentioned by either iCoder & Deepak didn't solve the problem for me.

I'm using React-Native to develop my apps including this React-Native-Permissions package I found. Their documentation states that I should add all the permission their package enables e.g. Location, Camera and all the others mentioned there. After I did this I was able to upload my application to the store and submit it for review.

Today I got to the office and I saw there was some feedback from Apple available. So after I completed the feedback I wanted to re-upload to the store again (increasing the build number as I'm supposed to do).

And now I keep getting the message in the title mentioned above while I have it present in my info.plist like such

<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>

EDIT:

I hope to clarify things below in order to find an answer to the problem I'm facing. The error given in the title occurs directly after uploading to the store (So I'm guessing the actual error is picked up the automatic checks done by the system).

The answer below won't help me to fix the problem since the more descriptive string wont be checked by the automatic system check. And I've successfully used this string for other elements in the info.plist. Next to this I found evidence that people successfully submit their app to the app store using this tactic. As shown by the comment of Gradner following this link React Native Permission issue 266

4条回答
【Aperson】
2楼-- · 2020-06-30 05:24

I can't figure out why the first time it wasn't working but when I got into the office today I saw the comment posted by Sumeet.Jain that suggested I should replace the

NSBluetoothPeripheralUsageDescription key with the NSBluetoothAlwaysUsageDescription key

This would actually result in an error that would say missing NSBluetoothPeripheralUsageDescription as we might expect it to. So then I re-added the NSBluetoothPeripheralUsageDescription to my info.plist and now I was finally able to upload my app to the store. Thanks for everyone that helped me.

p.s. The only thing I can think of I did differently compared to yesterday is that I now added the key using Xcode instead of just editing the info.plist file in my editor I use for react-native. Hopefully this helps others as it helped me

查看更多
够拽才男人
3楼-- · 2020-06-30 05:27

Someone posted an answer that helped me, but then deleted it! To paraphrase the answer:

Adding the privacy keys to the plist without knowing what is triggering the error from Apple is not the best way to solve this.

In my case, when I did a grep search I found that there is some reference to CoreBluetooth.framework inside my project.pbxproj. I removed the reference and the build and TestFlight upload succeeded!

To search use the following command:

grep -r -a CoreBluetooth.framework ProjectFolder
查看更多
Melony?
4楼-- · 2020-06-30 05:30

I got the root cause

We have below two default options in plist to enter the bluetooth usage.

1.Privacy - Bluetooth Peripheral Usage Description 2.Privacy - Bluetooth Always Usage Description

But Xcode save this option in the source code like the below

1.NSBluetoothPeripheralUsageDescription instead of Privacy - Bluetooth Peripheral Usage Description

2.Privacy - Bluetooth Always Usage Description instead of Privacy - Bluetooth Always Usage Description

So now the point is NSBluetoothPeripheralUsageDescription is deprecated and its expecting the key "NSBluetoothAlwaysUsageDescription"

Here is the solution, open the plist file as source code in Xcode and copy-paste the below key-value pair

Key: NSBluetoothAlwaysUsageDescription Value: This application requires bluetooth in order to bla bla bla.

查看更多
▲ chillily
5楼-- · 2020-06-30 05:51

If you are not using Bluetooth,

just add this to your Info.plist file:

<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 deprecated NSBluetoothPeripheralUsageDescription property in favor of NSBluetoothAlwaysUsageDescription.

See details here: link to Apple docs

If you are using bluetooth,

just add this to your Info.plist file:

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Our app uses bluetooth to find, connect and transfer data between different devices</string>
查看更多
登录 后发表回答