Skip to content

Commit 5959e7f

Browse files
authored
Merge pull request #514 from adjust/v4270
Version 4.27.0
2 parents a9985f2 + 603a2f0 commit 5959e7f

22 files changed

+109
-65
lines changed

Adjust.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "Adjust"
3-
s.version = "4.26.1"
3+
s.version = "4.27.0"
44
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
55
s.homepage = "https://github.com/adjust/ios_sdk"
66
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
77
s.author = { "Christian Wellenbrock" => "[email protected]" }
8-
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.26.1" }
8+
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.27.0" }
99
s.ios.deployment_target = '6.0'
1010
s.tvos.deployment_target = '9.0'
1111
s.framework = 'SystemConfiguration'

Adjust/ADJActivityHandler.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,9 +1725,11 @@ - (BOOL)shouldFetchAdServicesI:(ADJActivityHandler *)selfI {
17251725
- (void)checkForAdServicesAttributionI:(ADJActivityHandler *)selfI {
17261726
if (@available(iOS 14.3, tvOS 14.3, *)) {
17271727
if ([selfI shouldFetchAdServicesI:selfI]) {
1728-
NSError *error = nil;
1729-
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
1730-
[selfI setAdServicesAttributionToken:token error:error];
1728+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1729+
NSError *error = nil;
1730+
NSString *token = [[UIDevice currentDevice] adjFetchAdServicesAttribution:&error];
1731+
[selfI setAdServicesAttributionToken:token error:error];
1732+
});
17311733
}
17321734
}
17331735
}

Adjust/ADJPackageBuilder.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ - (NSMutableDictionary *)getMeasurementConsentParameters:(BOOL)enabled {
10881088
NSString *enableValue = enabled ? @"enable" : @"disable";
10891089
[ADJPackageBuilder parameters:parameters
10901090
setString:enableValue
1091-
forKey:@"sharing"];
1091+
forKey:@"measurement"];
10921092

10931093
if ([self.trackingStatusManager canGetAttStatus]) {
10941094
[ADJPackageBuilder parameters:parameters setInt:self.trackingStatusManager.attStatus

Adjust/ADJRequestHandler.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ - (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request
183183
[self.logger debug:@"Request succeeded with current URL strategy"];
184184
[self.urlStrategy resetAfterSuccess];
185185
[self.responseCallback responseCallback:responseData];
186-
} else if ([self.urlStrategy shouldRetryAfterFailure]) {
186+
} else if ([self.urlStrategy shouldRetryAfterFailure:responseData.activityKind]) {
187187
[self.logger debug:@"Request failed with current URL strategy, but it will be retried with new one"];
188188
[self retryWithResponseData:responseData
189189
methodTypeInfo:methodTypeInfo];
@@ -260,7 +260,7 @@ - (void)sendNSURLConnectionRequest:(NSMutableURLRequest *)request
260260
[self.logger debug:@"succeeded with current url strategy"];
261261
[self.urlStrategy resetAfterSuccess];
262262
[self.responseCallback responseCallback:responseData];
263-
} else if ([self.urlStrategy shouldRetryAfterFailure]) {
263+
} else if ([self.urlStrategy shouldRetryAfterFailure:responseData.activityKind]) {
264264
[self.logger debug:@"failed with current url strategy, but it will retry with new"];
265265
[self retryWithResponseData:responseData
266266
methodTypeInfo:methodTypeInfo];
@@ -393,6 +393,9 @@ - (void)handleResponseWithData:(NSData *)data
393393
NSString *urlString =
394394
[NSString stringWithFormat:@"%@%@%@?%@",
395395
urlHostString, self.urlStrategy.extraPath, path, queryStringParameters];
396+
397+
[self.logger verbose:@"Sending request to endpoint: %@",
398+
[NSString stringWithFormat:@"%@%@%@", urlHostString, self.urlStrategy.extraPath, path]];
396399

397400
// [self.logger verbose:@"requestForGetPackage with urlString: %@", urlString];
398401

Adjust/ADJUrlStrategy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
- (NSString *)getUrlHostStringByPackageKind:(ADJActivityKind)activityKind;
2020

2121
- (void)resetAfterSuccess;
22-
- (BOOL)shouldRetryAfterFailure;
22+
- (BOOL)shouldRetryAfterFailure:(ADJActivityKind)activityKind;
2323

2424
@end

Adjust/ADJUrlStrategy.m

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222
static NSString * const gdprUrlChina = @"https://gdpr.adjust.world";
2323
static NSString * const subscritionUrlChina = @"https://subscription.adjust.world";
2424

25+
static NSString * const baseUrlEU = @"https://app.eu.adjust.com";
26+
static NSString * const gdprUrlEU = @"https://gdpr.eu.adjust.com";
27+
static NSString * const subscriptionUrlEU = @"https://subscription.eu.adjust.com";
28+
29+
static NSString * const baseUrlTR = @"https://app.tr.adjust.com";
30+
static NSString * const gdprUrlTR = @"https://gdpr.tr.adjust.com";
31+
static NSString * const subscriptionUrlTR = @"https://subscription.tr.adjust.com";
32+
33+
static NSString * const baseUrlUS = @"https://app.us.adjust.com";
34+
static NSString * const gdprUrlUS = @"https://gdpr.us.adjust.com";
35+
static NSString * const subscriptionUrlUS = @"https://subscription.us.adjust.com";
36+
2537
@interface ADJUrlStrategy ()
2638

2739
@property (nonatomic, copy) NSArray<NSString *> *baseUrlChoicesArray;
@@ -71,6 +83,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
7183
return @[baseUrlIndia, baseUrl];
7284
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
7385
return @[baseUrlChina, baseUrl];
86+
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
87+
return @[baseUrlEU];
7488
} else {
7589
return @[baseUrl, baseUrlIndia, baseUrlChina];
7690
}
@@ -82,6 +96,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
8296
return @[gdprUrlIndia, gdprUrl];
8397
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
8498
return @[gdprUrlChina, gdprUrl];
99+
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
100+
return @[gdprUrlEU];
85101
} else {
86102
return @[gdprUrl, gdprUrlIndia, gdprUrlChina];
87103
}
@@ -93,6 +109,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
93109
return @[subscritionUrlIndia, subscriptionUrl];
94110
} else if ([urlStrategyInfo isEqualToString:ADJUrlStrategyChina]) {
95111
return @[subscritionUrlChina, subscriptionUrl];
112+
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyEU]) {
113+
return @[subscriptionUrlEU];
96114
} else {
97115
return @[subscriptionUrl, subscritionUrlIndia, subscritionUrlChina];
98116
}
@@ -125,12 +143,21 @@ - (void)resetAfterSuccess {
125143
self.wasLastAttemptSuccess = YES;
126144
}
127145

128-
- (BOOL)shouldRetryAfterFailure {
129-
NSUInteger nextChoiceIndex = (self.choiceIndex + 1) % self.baseUrlChoicesArray.count;
130-
self.choiceIndex = nextChoiceIndex;
131-
146+
- (BOOL)shouldRetryAfterFailure:(ADJActivityKind)activityKind {
132147
self.wasLastAttemptSuccess = NO;
133148

149+
NSUInteger choiceListSize;
150+
if (activityKind == ADJActivityKindGdpr) {
151+
choiceListSize = [_gdprUrlChoicesArray count];
152+
} else if (activityKind == ADJActivityKindSubscription) {
153+
choiceListSize = [_subscriptionUrlChoicesArray count];
154+
} else {
155+
choiceListSize = [_baseUrlChoicesArray count];
156+
}
157+
158+
NSUInteger nextChoiceIndex = (self.choiceIndex + 1) % choiceListSize;
159+
self.choiceIndex = nextChoiceIndex;
160+
134161
BOOL nextChoiceHasNotReturnedToStartingChoice = self.choiceIndex != self.startingChoiceIndex;
135162
return nextChoiceHasNotReturnedToStartingChoice;
136163
}

Adjust/ADJUtil.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
static CTTelephonyNetworkInfo *networkInfo = nil;
3838
#endif
3939

40-
static NSString * const kClientSdk = @"ios4.26.1";
40+
static NSString * const kClientSdk = @"ios4.27.0";
4141
static NSString * const kDeeplinkParam = @"deep_link=";
4242
static NSString * const kSchemeDelimiter = @"://";
4343
static NSString * const kDefaultScheme = @"AdjustUniversalScheme";

Adjust/Adjust.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Adjust.h
33
// Adjust
44
//
5-
// V4.26.1
5+
// V4.27.0
66
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
77
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
88
//
@@ -67,6 +67,7 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
6767
*/
6868
extern NSString * __nonnull const ADJUrlStrategyIndia;
6969
extern NSString * __nonnull const ADJUrlStrategyChina;
70+
extern NSString * __nonnull const ADJDataResidencyEU;
7071

7172
/**
7273
* @brief The main interface to Adjust.

Adjust/Adjust.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
NSString * const ADJUrlStrategyIndia = @"UrlStrategyIndia";
4646
NSString * const ADJUrlStrategyChina = @"UrlStrategyChina";
47+
NSString * const ADJDataResidencyEU = @"DataResidencyEU";
4748

4849
@implementation AdjustTestOptions
4950
@end

AdjustBridge/AdjustBridgeRegister.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ + (NSString *)adjust_js {
246246
if (this.sdkPrefix) {
247247
return this.sdkPrefix;
248248
} else {
249-
return 'web-bridge4.26.1';
249+
return 'web-bridge4.27.0';
250250
}
251251
},
252252
setTestOptions: function(testOptions) {
@@ -361,6 +361,7 @@ + (NSString *)adjust_js {
361361

362362
AdjustConfig.UrlStrategyIndia = 'UrlStrategyIndia';
363363
AdjustConfig.UrlStrategyChina = 'UrlStrategyChina';
364+
AdjustConfig.DataResidencyEU = 'DataResidencyEU';
364365

365366
AdjustConfig.prototype.registerCallbackHandlers = function() {
366367
var registerCallbackHandler = function(callbackName) {

0 commit comments

Comments
 (0)