diff --git a/Adjust.podspec b/Adjust.podspec index 5d9e4f271..df5eaa01d 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.11.2" + s.version = "4.11.3" s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." s.homepage = "https://github.com/adjust/ios_sdk" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Christian Wellenbrock" => "welle@adjust.com" } - s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.11.2" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.11.3" } s.ios.deployment_target = '6.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' diff --git a/Adjust/ADJPackageBuilder.m b/Adjust/ADJPackageBuilder.m index c61d4ab41..cf3b26e5a 100644 --- a/Adjust/ADJPackageBuilder.m +++ b/Adjust/ADJPackageBuilder.m @@ -53,6 +53,7 @@ - (ADJActivityPackage *)buildSessionPackage:(ADJSessionParameters *)sessionParam isInDelay:(BOOL)isInDelay { NSMutableDictionary *parameters = [self defaultParameters]; + [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setString:[ADJUtil getUpdateTime] forKey:@"app_updated_at"]; [ADJPackageBuilder parameters:parameters setString:[ADJUtil getInstallTime] forKey:@"installed_at"]; [ADJPackageBuilder parameters:parameters setDuration:self.activityState.lastInterval forKey:@"last_interval"]; @@ -77,6 +78,7 @@ - (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event isInDelay:(BOOL)isInDelay { NSMutableDictionary *parameters = [self defaultParameters]; + [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setInt:self.activityState.eventCount forKey:@"event_count"]; [ADJPackageBuilder parameters:parameters setNumber:event.revenue forKey:@"revenue"]; [ADJPackageBuilder parameters:parameters setString:event.currency forKey:@"currency"]; @@ -151,6 +153,7 @@ - (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource { - (ADJActivityPackage *)buildInfoPackage:(NSString *)infoSource { NSMutableDictionary *parameters = [self idsParameters]; + [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setString:infoSource forKey:@"source"]; [self injectPushToken:self.activityState intoParamters:parameters]; @@ -208,7 +211,6 @@ - (NSMutableDictionary *)defaultParameters { } - (void)injectCommonParameters:(NSMutableDictionary *)parameters { - [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setDate1970:self.createdAt forKey:@"created_at"]; [ADJPackageBuilder parameters:parameters setBool:YES forKey:@"attribution_deeplink"]; [ADJPackageBuilder parameters:parameters setBool:YES forKey:@"needs_response_details"]; diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index fc06df785..9fe736388 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -29,11 +29,9 @@ static NSRegularExpression *shortUniversalLinkRegex = nil; static NSURLSessionConfiguration *urlSessionConfiguration = nil; -static ADJConnectionValidator *connectionValidator = nil; - static NSString *userAgent = nil; -static NSString * const kClientSdk = @"ios4.11.2"; +static NSString * const kClientSdk = @"ios4.11.3"; static NSString * const kDeeplinkParam = @"deep_link="; static NSString * const kSchemeDelimiter = @"://"; static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; @@ -57,7 +55,6 @@ + (void)initialize { [self initializeShortUniversalLinkRegex]; [self initializeOptionalRedirectRegex]; [self initializeUrlSessionConfiguration]; - [self initializeConnectionValidator]; } + (void)initializeDateFormat { @@ -142,10 +139,6 @@ + (void)initializeUrlSessionConfiguration { urlSessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; } -+ (void)initializeConnectionValidator { - connectionValidator = [[ADJConnectionValidator alloc] init]; -} - + (void)updateUrlSessionConfiguration:(ADJConfig *)config { userAgent = config.userAgent; } @@ -435,14 +428,24 @@ + (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { - int tce = [[activityPackage.parameters objectForKey:@"tce"] intValue]; - - [connectionValidator setExpectedTce:tce]; - [connectionValidator setDidValidationHappen:NO]; + NSURLSession *session; + ADJConnectionValidator *connectionValidator; + + if (activityPackage.activityKind == ADJActivityKindEvent || + activityPackage.activityKind == ADJActivityKindSession || + activityPackage.activityKind == ADJActivityKindInfo) { + int tce = [[activityPackage.parameters objectForKey:@"tce"] intValue]; + + connectionValidator = [[ADJConnectionValidator alloc] init]; + [connectionValidator setExpectedTce:tce]; + [connectionValidator setDidValidationHappen:NO]; - NSURLSession *session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration - delegate:connectionValidator - delegateQueue:nil]; + session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration + delegate:connectionValidator + delegateQueue:nil]; + } else { + session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration]; + } NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler: @@ -454,10 +457,12 @@ + (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request suffixErrorMessage:suffixErrorMessage activityPackage:activityPackage]; - if (NO == connectionValidator.didValidationHappen) { - responseData.validationResult = YES; - } else { - responseData.validationResult = connectionValidator.validationResult; + if (nil != connectionValidator) { + if (NO == connectionValidator.didValidationHappen) { + responseData.validationResult = YES; + } else { + responseData.validationResult = connectionValidator.validationResult; + } } responseDataHandler(responseData); diff --git a/Adjust/Adjust.h b/Adjust/Adjust.h index 4634fba6a..974fb69a9 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.11.2 +// V4.11.3 // Created by Christian Wellenbrock on 2012-07-23. // Copyright (c) 2012-2014 adjust GmbH. All rights reserved. // diff --git a/AdjustTests/ADJPackageFields.m b/AdjustTests/ADJPackageFields.m index 3ab4e6f12..7dd1c04f3 100644 --- a/AdjustTests/ADJPackageFields.m +++ b/AdjustTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"qwerty123456"; - self.clientSdk = @"ios4.11.2"; + self.clientSdk = @"ios4.11.3"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/CHANGELOG.md b/CHANGELOG.md index 74a9ae64d..32d1e27fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 4.11.3 (23rd March 2017) +#### Changed +- Performing connection validity checks only on main package queue. + +--- + ### Version 4.11.2 (14th March 2017) #### Changed - Changed key name used to save persistent UUID to be unique per app. diff --git a/README.md b/README.md index 660382267..dbf01d61c 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ In the dialog `Choose options for adding these files` make sure to check the che If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate): ```ruby -pod 'Adjust', '~> 4.11.2' +pod 'Adjust', '~> 4.11.3' ``` or: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.11.2' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.11.3' ``` -- diff --git a/VERSION b/VERSION index 4f89fb960..e9fdaa8c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.11.2 +4.11.3 diff --git a/doc/english/migrate.md b/doc/english/migrate.md index 4a62cf593..7b829cd29 100644 --- a/doc/english/migrate.md +++ b/doc/english/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.11.2 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.11.3 from v3.4.0 ### Initial setup diff --git a/doc/japanese/migrate_ja.md b/doc/japanese/migrate_ja.md index 4fda2d3ea..b70a3c28a 100644 --- a/doc/japanese/migrate_ja.md +++ b/doc/japanese/migrate_ja.md @@ -1,4 +1,4 @@ -## iOS用adjust SDKのv3.4.0からv.4.11.2への移行 +## iOS用adjust SDKのv3.4.0からv.4.11.3への移行 ### 初期設定 diff --git a/doc/migrate.md b/doc/migrate.md index 4a62cf593..7b829cd29 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.11.2 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.11.3 from v3.4.0 ### Initial setup