Skip to content

Commit

Permalink
macOS: Add NSBluetoothAlwaysUsageDescription to macOS plists as well …
Browse files Browse the repository at this point in the history
…as iOS ones
  • Loading branch information
reuk committed Jul 8, 2020
1 parent 7fe7104 commit 8e19473
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions docs/CMake API.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ attributes directly to these creation functions, rather than adding them later.
- The text your app will display when it requests camera permissions.

- `BLUETOOTH_PERMISSION_ENABLED`
- May be either TRUE or FALSE. Adds the appropriate entries to an iOS app's Info.plist.
- May be either TRUE or FALSE. Adds the appropriate entries to an app's Info.plist.

- `BLUETOOTH_PERMISSION_TEXT`
- The text your iOS app will display when it requests bluetooth permissions.
- The text your app will display when it requests bluetooth permissions.

- `SEND_APPLE_EVENTS_PERMISSION_ENABLED`
- May be either TRUE or FALSE. Enable this to allow your app to send Apple events.
Expand Down
4 changes: 2 additions & 2 deletions extras/Build/CMake/JUCEUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1812,8 +1812,8 @@ function(_juce_initialise_target target)
CAMERA_PERMISSION_TEXT
SEND_APPLE_EVENTS_PERMISSION_ENABLED
SEND_APPLE_EVENTS_PERMISSION_TEXT
BLUETOOTH_PERMISSION_ENABLED # iOS only
BLUETOOTH_PERMISSION_TEXT # iOS only
BLUETOOTH_PERMISSION_ENABLED
BLUETOOTH_PERMISSION_TEXT
FILE_SHARING_ENABLED # iOS only
DOCUMENT_BROWSER_ENABLED # iOS only
LAUNCH_STORYBOARD_FILE # iOS only
Expand Down
6 changes: 3 additions & 3 deletions extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ namespace build_tools
if (cameraPermissionEnabled)
addPlistDictionaryKey (*dict, "NSCameraUsageDescription", cameraPermissionText);

if (bluetoothPermissionEnabled)
addPlistDictionaryKey (*dict, "NSBluetoothAlwaysUsageDescription", bluetoothPermissionText);

if (iOS)
{
if (bluetoothPermissionEnabled)
{
addPlistDictionaryKey (*dict, "NSBluetoothAlwaysUsageDescription", bluetoothPermissionText);
addPlistDictionaryKey (*dict, "NSBluetoothPeripheralUsageDescription", bluetoothPermissionText); // needed for pre iOS 13.0
}

addPlistDictionaryKey (*dict, "LSRequiresIPhoneOS", true);

Expand Down
28 changes: 13 additions & 15 deletions extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ class XcodeProjectExporter : public ProjectExporter
cameraPermissionNeededValue (settings, Ids::cameraPermissionNeeded, getUndoManager()),
cameraPermissionTextValue (settings, Ids::cameraPermissionText, getUndoManager(),
"This app requires access to the camera to function correctly."),
iosBluetoothPermissionNeededValue (settings, Ids::iosBluetoothPermissionNeeded, getUndoManager()),
iosBluetoothPermissionTextValue (settings, Ids::iosBluetoothPermissionText, getUndoManager(),
bluetoothPermissionNeededValue (settings, Ids::iosBluetoothPermissionNeeded, getUndoManager()),
bluetoothPermissionTextValue (settings, Ids::iosBluetoothPermissionText, getUndoManager(),
"This app requires access to Bluetooth to function correctly."),
sendAppleEventsPermissionNeededValue (settings, Ids::sendAppleEventsPermissionNeeded, getUndoManager()),
sendAppleEventsPermissionTextValue (settings, Ids::sendAppleEventsPermissionText, getUndoManager(),
Expand Down Expand Up @@ -251,8 +251,8 @@ class XcodeProjectExporter : public ProjectExporter
bool isCameraPermissionEnabled() const { return cameraPermissionNeededValue.get(); }
String getCameraPermissionTextString() const { return cameraPermissionTextValue.get(); }

bool isBluetoothPermissionEnabled() const { return iosBluetoothPermissionNeededValue.get(); }
String getBluetoothPermissionTextString() const { return iosBluetoothPermissionTextValue.get(); }
bool isBluetoothPermissionEnabled() const { return bluetoothPermissionNeededValue.get(); }
String getBluetoothPermissionTextString() const { return bluetoothPermissionTextValue.get(); }

bool isSendAppleEventsPermissionEnabled() const { return sendAppleEventsPermissionNeededValue.get(); }
String getSendAppleEventsPermissionTextString() const { return sendAppleEventsPermissionTextValue.get(); }
Expand Down Expand Up @@ -505,17 +505,15 @@ class XcodeProjectExporter : public ProjectExporter
"Camera Access Text", 1024, false),
"A short description of why your app requires camera access.");

if (iOS)
{
props.add (new ChoicePropertyComponent (iosBluetoothPermissionNeededValue, "Bluetooth Access"),
"Enable this to allow your app to use Bluetooth on iOS 13.0 and above. "
"The user of your app will be prompted to grant Bluetooth access permissions.");
props.add (new ChoicePropertyComponent (bluetoothPermissionNeededValue, "Bluetooth Access"),
"Enable this to allow your app to use Bluetooth on iOS 13.0 and above, and macOS 11.0 and above. "
"The user of your app will be prompted to grant Bluetooth access permissions.");

props.add (new TextPropertyComponentWithEnablement (iosBluetoothPermissionTextValue, iosBluetoothPermissionNeededValue,
"Bluetooth Access Text", 1024, false),
"A short description of why your app requires Bluetooth access.");
}
else
props.add (new TextPropertyComponentWithEnablement (bluetoothPermissionTextValue, bluetoothPermissionNeededValue,
"Bluetooth Access Text", 1024, false),
"A short description of why your app requires Bluetooth access.");

if (! iOS)
{
props.add (new ChoicePropertyComponent (sendAppleEventsPermissionNeededValue, "Send Apple Events"),
"Enable this to allow your app to send Apple events. "
Expand Down Expand Up @@ -1924,7 +1922,7 @@ class XcodeProjectExporter : public ProjectExporter
hardenedRuntimeValue, hardenedRuntimeOptionsValue,
microphonePermissionNeededValue, microphonePermissionsTextValue,
cameraPermissionNeededValue, cameraPermissionTextValue,
iosBluetoothPermissionNeededValue, iosBluetoothPermissionTextValue,
bluetoothPermissionNeededValue, bluetoothPermissionTextValue,
sendAppleEventsPermissionNeededValue, sendAppleEventsPermissionTextValue,
uiFileSharingEnabledValue, uiSupportsDocumentBrowserValue, uiStatusBarHiddenValue, documentExtensionsValue, iosInAppPurchasesValue,
iosContentSharingValue, iosBackgroundAudioValue, iosBackgroundBleValue, iosPushNotificationsValue, iosAppGroupsValue, iCloudPermissionsValue,
Expand Down

0 comments on commit 8e19473

Please sign in to comment.