Bluetooth Low Energy Scanner example permissions
-
Building bluetoothlowenergyscanner example from Qt 6.8.2. - builds fine no issues, but when I go to run the example I get the following error:
qt.permissions: Could not find permission plugin for QBluetoothPermission. Please make sure you have included the required usage description in your Info.plist
This example has no info.plist so how do I get this to run?Tom
-
Hi and welcome to devnet,
You can find that information in the iOS platform notes in Qt's documentation.
-
I haven't use QPermission yet however I don't see how it replaces the plist file.
QPermission allows to easily request and check permission however it does not replace things like iOS specific requirements such as providing proper justification for specific permissions.
-
Hi @nga_tom,
As per the docs:
Apple platforms
Each permission you request must be accompanied by a so called usage description string in the application's
Info.plist
file, describing why the application needs to access the given permission.<key>NSMicrophoneUsageDescription</key> <string>The microphone is used to record voice memos.</string>
Here's a complete example from one of my open source Qt projects: https://github.com/pcolby/dokit/blob/e734041b06e48d7aaf577bafa86359d05e001d05/src/cli/Info.plist.in#L27
You basically want to drop an
Info.plist
file that includes aNSBluetoothAlwaysUsageDescription
key/value, into your application binary's directory.You could also search the qtconnectivity repo for
Info.plist
to see some other examples, such as this one for the btscanner example: https://github.com/qt/qtconnectivity/blob/6f114cfd71ff970c6244d89e2d79f15c4229b2c6/tests/manual/examples/btscanner/Info.plistCheers.