Application written in C++ with Qt 5 does not request microphone permissions

Hi


I have created an application in Qt5.14.1 with C++, signed the application and notarized it. The application needs access to both microphone and camera, but when starting the installed application only camera access is requested. Starting the application from Qt Creator is requesting access for both camera and microphone, so this seems to be a problem with the installed application. The application is installed from a pkg file generated with pkgbuild.


My Info.plist file has the following content:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>MyAppName</string>
<key>CFBundleVersion</key>
<string>3.6.0.0</string>
<key>CFBundleShortVersionString</key>
<string>3.6.0.0</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<key>CFBundleIdentifier</key>
<string>com.company.myapp</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>The application wants to access the camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The application wants to access the microphone.</string>
</dict>
</plist>


and Entitlements.plist:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
</dict>
</plist>


Can you tell me what I am doing wrong ?


thanks

Bogdan

Replies

Are you really using "com.company.myapp" as your bundle identifier? That's going to cause no end of problems, even in development.


For things like this, it is really useful to run macOS in a pristine VM. You should consider your developer machine hopelessly confused about all things like this.