Browse Source

macOS: Add NSBluetoothAlwaysUsageDescription to macOS plists as well as iOS ones

tags/2021-05-28
reuk 5 years ago
parent
commit
8e19473b52
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
4 changed files with 20 additions and 22 deletions
  1. +2
    -2
      docs/CMake API.md
  2. +2
    -2
      extras/Build/CMake/JUCEUtils.cmake
  3. +3
    -3
      extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp
  4. +13
    -15
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h

+ 2
- 2
docs/CMake API.md View File

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


+ 2
- 2
extras/Build/CMake/JUCEUtils.cmake View File

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


+ 3
- 3
extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp View File

@@ -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);


+ 13
- 15
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h View File

@@ -159,8 +159,8 @@ public:
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(),
@@ -251,8 +251,8 @@ public:
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(); }
@@ -505,17 +505,15 @@ public:
"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. "
@@ -1924,7 +1922,7 @@ private:
hardenedRuntimeValue, hardenedRuntimeOptionsValue,
microphonePermissionNeededValue, microphonePermissionsTextValue,
cameraPermissionNeededValue, cameraPermissionTextValue,
iosBluetoothPermissionNeededValue, iosBluetoothPermissionTextValue,
bluetoothPermissionNeededValue, bluetoothPermissionTextValue,
sendAppleEventsPermissionNeededValue, sendAppleEventsPermissionTextValue,
uiFileSharingEnabledValue, uiSupportsDocumentBrowserValue, uiStatusBarHiddenValue, documentExtensionsValue, iosInAppPurchasesValue,
iosContentSharingValue, iosBackgroundAudioValue, iosBackgroundBleValue, iosPushNotificationsValue, iosAppGroupsValue, iCloudPermissionsValue,


Loading…
Cancel
Save