NSBluetoothAlwaysUsageDescription required, but bluetooth is not used

前端 未结 10 1829
青春惊慌失措
青春惊慌失措 2021-01-01 18:28

In my ios app with new Xcode 11 GM Seed 2 after deploy, apple returned error: ITMS-90683: Missing Purpose String in Info.plist with NSBluetoothAlwaysUsageDe

10条回答
  •  -上瘾入骨i
    2021-01-01 19:20

    You should add both NSBluetoothPeripheralUsageDescription and NSBluetoothAlwaysUsageDescription to your Info.plist file. Your Info.plist file is located (by default) inside your prroject folder "Supporting Files" group and may be called something like {PROJECTNAME}-Info.plist. You have a couple of choices for adding it. One choice is to just editthe file from the command line using vim or whatever. Then add these lines:

    NSBluetoothAlwaysUsageDescription
    App would like to use your bluetooth for communication purposes
    NSBluetoothPeripheralUsageDescription
    App would like to use your bluetooth for communication purposes
    

    The second choice is to double click that Info.plist file in XCode and use the "super helpful" XCode editor. This annoying editor does not actually have the NSBluetoothAlwaysUsageDescription in a dropdown list, you have to add it manually. Super helpful. Anyway there is a little plus button to the right of the Information Property List header, just click that. In step 1 you look for "Privacy - Bluetooth Peripheral Usage Description". That is the readable name for NSBluetoothPeripheralUsageDescription. Then just click on the value part at the right and enter your text, like "App would like to use your bluetooth for communication purposes" or watever. Once that is done, click that same plus button again and you will get the same drpdown list. Ignore that list and just paste the string NSBluetoothAlwaysUsageDescription there. Then click on the value to the right and paste "App would like to use your bluetooth for communication purposes".

提交回复
热议问题