Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDL-0008] iOS 6 Removal #449

Merged
merged 13 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ See the [roadmap](https://github.com/smartdevicelink/sdl_ios/wiki/Roadmap) to se

You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartDeviceLink-iOS). You can get started with Cocoapods by [following their install guide](https://guides.cocoapods.org/using/getting-started.html#getting-started), and learn how to use Cocoapods to install dependencies [by following this guide](https://guides.cocoapods.org/using/using-cocoapods.html).

In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.3.0-rc.3'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 6.0+.
In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.3.0-rc.3'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 7.0+.

##### Carthage

Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" }
s.platform = :ios, "6.0"
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.source_files = "SmartDeviceLink/*.{h,m}"
s.requires_arc = true
Expand Down
40 changes: 0 additions & 40 deletions SmartDeviceLink-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,6 @@
5DBAE0AB1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */; };
5DBAE0AD1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */; };
5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */; };
5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */; };
5DCC19A11B8221F3004FFAD9 /* SDLURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */; };
5DCC19A41B822804004FFAD9 /* SDLURLRequestTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */; };
5DCC19A51B822804004FFAD9 /* SDLURLRequestTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */; };
5DCF76F51ACDBAD300BB647B /* SDLSendLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCF76F31ACDBAD300BB647B /* SDLSendLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
5DCF76F61ACDBAD300BB647B /* SDLSendLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCF76F41ACDBAD300BB647B /* SDLSendLocation.m */; };
5DCF76F91ACDD7CD00BB647B /* SDLSendLocationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCF76F71ACDD7CD00BB647B /* SDLSendLocationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -882,8 +878,6 @@
5DE372A61ACC35B400849FAA /* SDLDebugToolConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE372A51ACC35B400849FAA /* SDLDebugToolConsole.h */; settings = {ATTRIBUTES = (Public, ); }; };
5DE5ABB71B0E38C90067BB02 /* SDLSystemRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD21A84238B00846EE7 /* SDLSystemRequest.h */; };
5DE5ABB81B0E38C90067BB02 /* SDLSystemRequestResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD41A84238B00846EE7 /* SDLSystemRequestResponse.h */; };
5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */; };
5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */; };
5DFFB9151BD7C89700DB3F04 /* SDLConnectionManagerType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */; };
DA4353DF1D271FD10099B8C4 /* CGPointUtilSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */; };
DA4353E31D2720A30099B8C4 /* SDLPinchGestureSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */; };
Expand Down Expand Up @@ -1854,10 +1848,6 @@
5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLNotificationDispatcherSpec.m; path = DevAPISpecs/SDLNotificationDispatcherSpec.m; sourceTree = "<group>"; };
5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLResponseDispatcherSpec.m; path = DevAPISpecs/SDLResponseDispatcherSpec.m; sourceTree = "<group>"; };
5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLGlobalsSpec.m; path = UtilitiesSpecs/SDLGlobalsSpec.m; sourceTree = "<group>"; };
5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLURLSession.h; sourceTree = "<group>"; };
5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLURLSession.m; sourceTree = "<group>"; };
5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLURLRequestTask.h; sourceTree = "<group>"; };
5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLURLRequestTask.m; sourceTree = "<group>"; };
5DCF76F31ACDBAD300BB647B /* SDLSendLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendLocation.h; sourceTree = "<group>"; };
5DCF76F41ACDBAD300BB647B /* SDLSendLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSendLocation.m; sourceTree = "<group>"; };
5DCF76F71ACDD7CD00BB647B /* SDLSendLocationResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendLocationResponse.h; sourceTree = "<group>"; };
Expand All @@ -1868,8 +1858,6 @@
5DE372A01ACB2ED300849FAA /* SDLHMICapabilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLHMICapabilities.m; sourceTree = "<group>"; };
5DE372A31ACB336600849FAA /* SDLHMICapabilitiesSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLHMICapabilitiesSpec.m; sourceTree = "<group>"; };
5DE372A51ACC35B400849FAA /* SDLDebugToolConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLDebugToolConsole.h; sourceTree = "<group>"; };
5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLRequestTaskSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m"; sourceTree = "<group>"; };
5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLSessionSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m"; sourceTree = "<group>"; };
5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLConnectionManagerType.h; sourceTree = "<group>"; };
DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CGPointUtilSpec.m; path = UtilitiesSpecs/Touches/CGPointUtilSpec.m; sourceTree = "<group>"; };
DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLPinchGestureSpec.m; path = UtilitiesSpecs/Touches/SDLPinchGestureSpec.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2945,7 +2933,6 @@
isa = PBXGroup;
children = (
DAC5724C1D0FE3B60004288B /* Touches */,
5DCC199D1B8221D2004FFAD9 /* HTTP Connection */,
E9C32B831AB20B2900F283AF /* @categories */,
5D5934F71A8519A700687FB9 /* JSON */,
5D5934F91A851A8000687FB9 /* Prioritized Objects */,
Expand Down Expand Up @@ -3496,7 +3483,6 @@
isa = PBXGroup;
children = (
DA1166D71D14601C00438CEA /* Touches */,
5DEE55BE1B8509A5004F0D0F /* HTTP Connection */,
5DB92D2B1AC4A32A00C15BB0 /* Prioritized Objects */,
5DB92D231AC47B2C00C15BB0 /* SDLHexUtilitySpec.m */,
5DB92D251AC4836F00C15BB0 /* SDLJingleSpec.m */,
Expand Down Expand Up @@ -3568,17 +3554,6 @@
name = Dispatchers;
sourceTree = "<group>";
};
5DCC199D1B8221D2004FFAD9 /* HTTP Connection */ = {
isa = PBXGroup;
children = (
5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */,
5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */,
5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */,
5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */,
);
name = "HTTP Connection";
sourceTree = "<group>";
};
5DE372A71ACC35C100849FAA /* @protocols */ = {
isa = PBXGroup;
children = (
Expand All @@ -3587,15 +3562,6 @@
name = "@protocols";
sourceTree = "<group>";
};
5DEE55BE1B8509A5004F0D0F /* HTTP Connection */ = {
isa = PBXGroup;
children = (
5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */,
5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */,
);
name = "HTTP Connection";
sourceTree = "<group>";
};
DA1166D71D14601C00438CEA /* Touches */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3776,7 +3742,6 @@
5D61FD5F1A84238C00846EE7 /* SDLRegisterAppInterfaceResponse.h in Headers */,
5D61FD191A84238C00846EE7 /* SDLOnSyncPData.h in Headers */,
5D61FE091A84238C00846EE7 /* SDLVehicleDataType.h in Headers */,
5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */,
5D61FDB11A84238C00846EE7 /* SDLSubscribeVehicleData.h in Headers */,
5DCF76F51ACDBAD300BB647B /* SDLSendLocation.h in Headers */,
5D61FC9E1A84238C00846EE7 /* SDLEncodedSyncPData.h in Headers */,
Expand Down Expand Up @@ -3874,7 +3839,6 @@
5D6F7A351BC5B9B60070BF37 /* SDLLockScreenViewController.h in Headers */,
5D61FCE41A84238C00846EE7 /* SDLKeyboardProperties.h in Headers */,
5D61FDED1A84238C00846EE7 /* SDLUnsubscribeVehicleDataResponse.h in Headers */,
5DCC19A41B822804004FFAD9 /* SDLURLRequestTask.h in Headers */,
5D61FCCF1A84238C00846EE7 /* SDLImageField.h in Headers */,
5D535DC51B72473800CF7760 /* SDLGlobals.h in Headers */,
5D79A03B1CE36F030035797B /* SDLUploadFileOperation.h in Headers */,
Expand Down Expand Up @@ -4131,7 +4095,6 @@
buildActionMask = 2147483647;
files = (
332A914F1CED9CC60043824C /* SDLAppInfo.m in Sources */,
5DCC19A51B822804004FFAD9 /* SDLURLRequestTask.m in Sources */,
5D61FC561A84238C00846EE7 /* SDLButtonName.m in Sources */,
5D61FCC21A84238C00846EE7 /* SDLHMILevel.m in Sources */,
5D61FDEC1A84238C00846EE7 /* SDLUnsubscribeVehicleData.m in Sources */,
Expand Down Expand Up @@ -4260,7 +4223,6 @@
5D61FC4E1A84238C00846EE7 /* SDLBitsPerSample.m in Sources */,
5D61FDEA1A84238C00846EE7 /* SDLUnsubscribeButtonResponse.m in Sources */,
5D61FCA61A84238C00846EE7 /* SDLEndAudioPassThruResponse.m in Sources */,
5DCC19A11B8221F3004FFAD9 /* SDLURLSession.m in Sources */,
5D61FD281A84238C00846EE7 /* SDLPerformAudioPassThruResponse.m in Sources */,
5D61FDCE1A84238C00846EE7 /* SDLTimerMode.m in Sources */,
5D61FD701A84238C00846EE7 /* SDLRPCPayload.m in Sources */,
Expand Down Expand Up @@ -4496,7 +4458,6 @@
162E836C1A9BDE8B00906325 /* SDLSystemRequestResponseSpec.m in Sources */,
162E833C1A9BDE8B00906325 /* SDLSetMediaClockTimerSpec.m in Sources */,
162E83061A9BDE8B00906325 /* SDLVehicleDataEventStatusSpec.m in Sources */,
5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */,
162E83911A9BDE8B00906325 /* SDLTouchCoordSpec.m in Sources */,
162E832B1A9BDE8B00906325 /* SDLDeleteSubMenuSpec.m in Sources */,
162E83411A9BDE8B00906325 /* SDLSubscribeButtonSpec.m in Sources */,
Expand Down Expand Up @@ -4570,7 +4531,6 @@
162E82FB1A9BDE8B00906325 /* SDLSpeechCapabilitiesSpec.m in Sources */,
162E830D1A9BDE8B00906325 /* SDLWiperStatusSpec.m in Sources */,
162E832C1A9BDE8B00906325 /* SDLDiagnosticMessageSpec.m in Sources */,
5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */,
162E83381A9BDE8B00906325 /* SDLScrollableMessageSpec.m in Sources */,
162E82E81A9BDE8B00906325 /* SDLKeyboardLayoutSpec.m in Sources */,
DA4353EB1D2721680099B8C4 /* SDLTouchSpec.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<string>7.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
Expand Down
67 changes: 46 additions & 21 deletions SmartDeviceLink/SDLProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@
#import "SDLSystemContext.h"
#import "SDLSystemRequest.h"
#import "SDLTimer.h"
#import "SDLURLSession.h"
#import "SDLVehicleType.h"

typedef NSString SDLVehicleMake;

typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error);
typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error);

NSString *const SDLProxyVersion = @"4.3.0-rc.3";
const float startSessionTime = 10.0;
const float notifyProxyClosedDelay = 0.1;
const int POLICIES_CORRELATION_ID = 65535;

static float DefaultConnectionTimeout = 45.0;

@interface SDLProxy () {
SDLLockScreenStatusManager *_lsm;
Expand All @@ -65,6 +63,7 @@ @interface SDLProxy () {
@property (nonatomic, strong, readwrite, nullable) SDLStreamingMediaManager *streamingMediaManager;
@property (nonatomic, strong, nullable) SDLDisplayCapabilities *displayCapabilities;
@property (nonatomic, strong) NSMutableDictionary<SDLVehicleMake *, Class> *securityManagers;
@property (nonatomic, strong) NSURLSession* urlSession;

@end

Expand All @@ -90,6 +89,14 @@ - (instancetype)initWithTransport:(SDLAbstractTransport *)transport protocol:(SD

[SDLDebugTool logInfo:@"SDLProxy initWithTransport"];
[[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications];

NSURLSessionConfiguration* configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
configuration.timeoutIntervalForRequest = DefaultConnectionTimeout;
configuration.timeoutIntervalForResource = DefaultConnectionTimeout;
configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy;

_urlSession = [NSURLSession sessionWithConfiguration:configuration];

}

return self;
Expand All @@ -102,8 +109,9 @@ - (void)destructObjects {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[EAAccessoryManager sharedAccessoryManager] unregisterForLocalNotifications];

[[SDLURLSession defaultSession] cancelAllTasks];

[self.urlSession invalidateAndCancel];
_urlSession = nil;

[self.protocol dispose];
[self.transport dispose];

Expand Down Expand Up @@ -533,17 +541,17 @@ - (void)handleSystemRequestProprietary:(SDLOnSystemRequest *)request {
}

- (void)handleSystemRequestLockScreenIconURL:(SDLOnSystemRequest *)request {
[[SDLURLSession defaultSession] dataFromURL:[NSURL URLWithString:request.url]
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error != nil) {
NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription];
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
return;
}
[self sdl_sendDataTaskWithURL:[NSURL URLWithString:request.url]
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error != nil) {
NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription];
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
return;
}

UIImage *icon = [UIImage imageWithData:data];
[self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon];
}];
UIImage *icon = [UIImage imageWithData:data];
[self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon];
}];
}

- (void)sdl_handleSystemRequestHTTP:(SDLOnSystemRequest *)request {
Expand Down Expand Up @@ -637,7 +645,7 @@ - (void)sdl_uploadData:(NSData *_Nonnull)data toURLString:(NSString *_Nonnull)ur
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];

// Create the upload task
[[SDLURLSession defaultSession] uploadWithURLRequest:request data:data completionHandler:completionHandler];
[self sdl_sendUploadRequest:request withData:data completionHandler:completionHandler];
}

/**
Expand Down Expand Up @@ -673,9 +681,26 @@ - (void)uploadForBodyDataDictionary:(NSDictionary *)dictionary URLString:(NSStri
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];

// Create the upload task
[[SDLURLSession defaultSession] uploadWithURLRequest:request data:bodyData completionHandler:completionHandler];
[self sdl_sendUploadRequest:request withData:bodyData completionHandler:completionHandler];
}

- (void)sdl_sendUploadRequest:(NSURLRequest*)request withData:(NSData*)data completionHandler:(URLSessionTaskCompletionHandler)completionHandler {
NSMutableURLRequest* mutableRequest = [request mutableCopy];

if ([mutableRequest.URL.scheme isEqualToString:@"http"]) {
mutableRequest.URL = [NSURL URLWithString:[mutableRequest.URL.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
}

[[self.urlSession uploadTaskWithRequest:request fromData:data completionHandler:completionHandler] resume];
}

- (void)sdl_sendDataTaskWithURL:(NSURL*)url completionHandler:(URLSessionTaskCompletionHandler)completionHandler {
if ([url.scheme isEqualToString:@"http"]) {
url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
}

[[self.urlSession dataTaskWithURL:url completionHandler:completionHandler] resume];
}

#pragma mark - Delegate management

Expand Down Expand Up @@ -728,11 +753,11 @@ - (void)sendEncodedSyncPData:(NSDictionary *)encodedSyncPData toURL:(NSString *)
}

// Send the HTTP Request
[[SDLURLSession defaultSession] uploadWithURLRequest:request
data:data
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
[[[NSURLSession sharedSession] uploadTaskWithRequest:request
fromData:data
completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
[self syncPDataNetworkRequestCompleteWithData:data response:response error:error];
}];
}] resume];

[SDLDebugTool logInfo:@"OnEncodedSyncPData (HTTP request)" withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
}
Expand Down
Loading