diff options
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m index 94ba0a751..9475d1de8 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m @@ -324,6 +324,8 @@ const int POLICIES_CORRELATION_ID = 65535; [self handleSystemRequestLockScreenIconURL:systemRequest]; } else if (requestType == [SDLRequestType HTTP]) { [self sdl_handleSystemRequestHTTP:systemRequest]; + } else if (requestType == [SDLRequestType LAUNCH_APP]) { + [self sdl_handleSystemRequestLaunchApp:systemRequest]; } } @@ -354,6 +356,16 @@ const int POLICIES_CORRELATION_ID = 65535; #pragma mark OnSystemRequest Handlers +- (void)sdl_handleSystemRequestLaunchApp:(SDLOnSystemRequest *)request { + NSURL *URLScheme = [NSURL URLWithString:request.url]; + if (URLScheme == nil) { + [SDLDebugTool logInfo:[NSString stringWithFormat:@"Launch App failure: invalid URL sent from module: %@", request.url] withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; + return; + } + + [[UIApplication sharedApplication] openURL:URLScheme]; +} + - (void)handleSystemRequestProprietary:(SDLOnSystemRequest *)request { NSDictionary *JSONDictionary = [self validateAndParseSystemRequest:request]; if (JSONDictionary == nil || request.url == nil) { |