Browse Source

iOS: Fixed an openURL iOS 10 deprecation

tags/2021-05-28
tpoole 7 years ago
parent
commit
fe134173f6
2 changed files with 12 additions and 1 deletions
  1. +7
    -1
      modules/juce_audio_devices/native/juce_ios_Audio.cpp
  2. +5
    -0
      modules/juce_core/native/juce_mac_Files.mm

+ 7
- 1
modules/juce_audio_devices/native/juce_ios_Audio.cpp View File

@@ -576,7 +576,13 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
&hostUrl,
&dataSize);
if (err == noErr)
[[UIApplication sharedApplication] openURL:(NSURL*)hostUrl];
{
#if (! defined __IPHONE_OS_VERSION_MIN_REQUIRED) || (! defined __IPHONE_10_0) || (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)
[[UIApplication sharedApplication] openURL: (NSURL*)hostUrl];
#else
[[UIApplication sharedApplication] openURL: (NSURL*)hostUrl options: @{} completionHandler: nil];
#endif
}
}
//==============================================================================


+ 5
- 0
modules/juce_core/native/juce_mac_Files.mm View File

@@ -402,7 +402,12 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String&
if (SystemStats::isRunningInAppExtensionSandbox())
return false;
#if (! defined __IPHONE_OS_VERSION_MIN_REQUIRED) || (! defined __IPHONE_10_0) || (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)
return [[UIApplication sharedApplication] openURL: filenameAsURL];
#else
[[UIApplication sharedApplication] openURL: filenameAsURL options: @{} completionHandler: nil];
return true;
#endif
#else
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];


Loading…
Cancel
Save