diff options
author | Justin Dickow <jjdickow@gmail.com> | 2016-03-10 13:44:33 -0500 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2016-03-10 13:44:33 -0500 |
commit | 878b405b3899df355a0c7929648955073e5c7288 (patch) | |
tree | 40e40f906d2ec47f668909390367cd88dcd72309 | |
parent | b1e8ef3bb073b132592c39ae3f994af1b4ee328e (diff) | |
download | sdl_ios-878b405b3899df355a0c7929648955073e5c7288.tar.gz |
Check OS version in LAUNCH_APP
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m index 769044dce..18a09d0b1 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m @@ -362,7 +362,13 @@ const int POLICIES_CORRELATION_ID = 65535; [SDLDebugTool logInfo:[NSString stringWithFormat:@"Launch App failure: invalid URL sent from module: %@", request.url] withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; return; } - + // If system version is less than 9.0 http://stackoverflow.com/a/5337804/1370927 + if ([[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] == NSOrderedAscending) { + // Return early if we can't openURL because openURL will crash instead of fail silently in < 9.0 + if ([[UIApplication sharedApplication] canOpenURL:URLScheme] == NO) { + return; + } + } [[UIApplication sharedApplication] openURL:URLScheme]; } |