Skip to content

Commit

Permalink
Merge pull request #282 from adjust/v4113
Browse files Browse the repository at this point in the history
Version 4.11.3
  • Loading branch information
uerceg authored Mar 23, 2017
2 parents a3462b4 + a2d064a commit a90e8a2
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 3 additions & 1 deletion Adjust/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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"];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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"];
Expand Down
43 changes: 24 additions & 19 deletions Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -57,7 +55,6 @@ + (void)initialize {
[self initializeShortUniversalLinkRegex];
[self initializeOptionalRedirectRegex];
[self initializeUrlSessionConfiguration];
[self initializeConnectionValidator];
}

+ (void)initializeDateFormat {
Expand Down Expand Up @@ -142,10 +139,6 @@ + (void)initializeUrlSessionConfiguration {
urlSessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
}

+ (void)initializeConnectionValidator {
connectionValidator = [[ADJConnectionValidator alloc] init];
}

+ (void)updateUrlSessionConfiguration:(ADJConfig *)config {
userAgent = config.userAgent;
}
Expand Down Expand Up @@ -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:
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion AdjustTests/ADJPackageFields.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```

--
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.11.2
4.11.3
2 changes: 1 addition & 1 deletion doc/english/migrate.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion doc/japanese/migrate_ja.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## iOS用adjust SDKのv3.4.0からv.4.11.2への移行
## iOS用adjust SDKのv3.4.0からv.4.11.3への移行

### 初期設定

Expand Down
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit a90e8a2

Please sign in to comment.