diff options
author | Justin Dickow <jjdickow@gmail.com> | 2016-03-09 16:32:45 -0500 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2016-03-09 16:32:45 -0500 |
commit | 7eb79012a1ebfcd21d0047b51b8debc8b3bcc9e1 (patch) | |
tree | 8cd08cc0f1aac1a748c41709f17689e4e8b8081a | |
parent | b028efe0841b3ccef8395650f2d6dd89e520bfe2 (diff) | |
download | sdl_ios-7eb79012a1ebfcd21d0047b51b8debc8b3bcc9e1.tar.gz |
Add support for LAUNCH_APP system request
-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 806575f0f..a09f33303 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 handleSystemRequestHTTP:systemRequest]; + } else if (requestType == [SDLRequestType LAUNCH_APP]) { + [self handleSystemRequestLockScreenIconURL:systemRequest]; } } @@ -354,6 +356,16 @@ const int POLICIES_CORRELATION_ID = 65535; #pragma mark OnSystemRequest Handlers +- (void)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) { |