Skip to content

Commit

Permalink
Merge pull request #541 from adjust/v4292
Browse files Browse the repository at this point in the history
Version 4.29.2
  • Loading branch information
uerceg authored May 12, 2021
2 parents 268f3e8 + 9dc78d8 commit e79ef64
Show file tree
Hide file tree
Showing 20 changed files with 1,549 additions and 1,072 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.29.1"
s.version = "4.29.2"
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" => "[email protected]" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.29.1" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.29.2" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJLinkResolution.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "ADJLinkResolution.h"

static NSUInteger kMaxRecursions = 3;
static NSUInteger kMaxRecursions = 10;

@interface ADJLinkResolutionDelegate : NSObject<NSURLSessionTaskDelegate>

Expand Down
10 changes: 9 additions & 1 deletion Adjust/ADJPackageBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ - (NSMutableDictionary *)getAdRevenueParameters:(ADJAdRevenue *)adRevenue isInDe
[ADJPackageBuilder parameters:parameters setDate1970:(double)self.packageParams.startedAt forKey:@"started_at"];

[ADJPackageBuilder parameters:parameters setString:adRevenue.source forKey:@"source"];
[ADJPackageBuilder parameters:parameters setNumber:adRevenue.revenue forKey:@"revenue"];
[ADJPackageBuilder parameters:parameters setNumberWithoutRounding:adRevenue.revenue forKey:@"revenue"];
[ADJPackageBuilder parameters:parameters setString:adRevenue.currency forKey:@"currency"];
[ADJPackageBuilder parameters:parameters setNumberInt:adRevenue.adImpressionsCount forKey:@"ad_impressions_count"];
[ADJPackageBuilder parameters:parameters setString:adRevenue.adRevenueNetwork forKey:@"ad_revenue_network"];
Expand Down Expand Up @@ -1208,6 +1208,14 @@ + (void)parameters:(NSMutableDictionary *)parameters setNumber:(NSNumber *)value
[ADJPackageBuilder parameters:parameters setString:numberString forKey:key];
}

+ (void)parameters:(NSMutableDictionary *)parameters setNumberWithoutRounding:(NSNumber *)value forKey:(NSString *)key {
if (value == nil) {
return;
}
NSString *numberString = [value stringValue];
[ADJPackageBuilder parameters:parameters setString:numberString forKey:key];
}

+ (void)parameters:(NSMutableDictionary *)parameters setNumberInt:(NSNumber *)value forKey:(NSString *)key {
if (value == nil) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJRequestHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ - (void)handleResponseWithData:(NSData *)data
NSString *urlString = [NSString stringWithFormat:@"%@%@%@",
urlHostString, self.urlStrategy.extraPath, path];

[self.logger verbose:@"Makig request to endpoint: %@", urlString];
[self.logger verbose:@"Sending request to endpoint: %@", urlString];

NSURL *url = [NSURL URLWithString:urlString];
//NSURL *url = [baseUrl URLByAppendingPathComponent:path];
Expand Down
6 changes: 6 additions & 0 deletions Adjust/ADJUrlStrategy.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[baseUrlEU];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyTR]) {
return @[baseUrlTR];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyUS]) {
return @[baseUrlUS];
} else {
return @[baseUrl, baseUrlIndia, baseUrlChina];
}
Expand All @@ -100,6 +102,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[gdprUrlEU];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyTR]) {
return @[gdprUrlTR];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyUS]) {
return @[gdprUrlUS];
} else {
return @[gdprUrl, gdprUrlIndia, gdprUrlChina];
}
Expand All @@ -114,6 +118,8 @@ - (instancetype)initWithUrlStrategyInfo:(NSString *)urlStrategyInfo
return @[subscriptionUrlEU];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyTR]) {
return @[subscriptionUrlTR];
} else if ([urlStrategyInfo isEqualToString:ADJDataResidencyUS]) {
return @[subscriptionUrlUS];
} else {
return @[subscriptionUrl, subscritionUrlIndia, subscritionUrlChina];
}
Expand Down
16 changes: 11 additions & 5 deletions Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
static NSRegularExpression *shortUniversalLinkRegex = nil;
static NSRegularExpression *excludedDeeplinkRegex = nil;

static NSString * const kClientSdk = @"ios4.29.1";
static NSString * const kClientSdk = @"ios4.29.2";
static NSString * const kDeeplinkParam = @"deep_link=";
static NSString * const kSchemeDelimiter = @"://";
static NSString * const kDefaultScheme = @"AdjustUniversalScheme";
Expand Down Expand Up @@ -457,10 +457,16 @@ + (BOOL)checkForDirectoryPresenceInPath:(NSString *)path forFolder:(NSString *)f
if (![man respondsToSelector:selExi]) {
return NO;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
BOOL exists = (BOOL)[man performSelector:selExi withObject:path];
#pragma clang diagnostic pop

NSInvocation *invMan = [NSInvocation invocationWithMethodSignature:[man methodSignatureForSelector:selExi]];
[invMan setSelector:selExi];
[invMan setTarget:man];
[invMan setArgument:&path atIndex:2];
[invMan invoke];

BOOL exists;
[invMan getReturnValue:&exists];

if (!exists) {
[[ADJAdjustFactory logger] debug:@"%@ directory not present and will be created", folderName];
BOOL withIntermediateDirectories = NO;
Expand Down
3 changes: 2 additions & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Adjust.h
// Adjust SDK
//
// V4.29.1
// V4.29.2
// Created by Christian Wellenbrock (@wellle) on 23rd July 2013.
// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved.
//
Expand Down Expand Up @@ -55,6 +55,7 @@ extern NSString * __nonnull const ADJUrlStrategyIndia;
extern NSString * __nonnull const ADJUrlStrategyChina;
extern NSString * __nonnull const ADJDataResidencyEU;
extern NSString * __nonnull const ADJDataResidencyTR;
extern NSString * __nonnull const ADJDataResidencyUS;

/**
* @brief The main interface to Adjust.
Expand Down
1 change: 1 addition & 0 deletions Adjust/Adjust.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

NSString * const ADJDataResidencyEU = @"DataResidencyEU";
NSString * const ADJDataResidencyTR = @"DataResidencyTR";
NSString * const ADJDataResidencyUS = @"DataResidencyUS";

@implementation AdjustTestOptions
@end
Expand Down
3 changes: 2 additions & 1 deletion AdjustBridge/AdjustBridgeRegister.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ + (NSString *)adjust_js {
if (this.sdkPrefix) {
return this.sdkPrefix;
} else {
return 'web-bridge4.29.1';
return 'web-bridge4.29.2';
}
},
setTestOptions: function(testOptions) {
Expand Down Expand Up @@ -363,6 +363,7 @@ + (NSString *)adjust_js {
AdjustConfig.UrlStrategyChina = 'UrlStrategyChina';
AdjustConfig.DataResidencyEU = 'DataResidencyEU';
AdjustConfig.DataResidencyTR = 'DataResidencyTR';
AdjustConfig.DataResidencyUS = 'DataResidencyUS';

AdjustConfig.prototype.registerCallbackHandlers = function() {
var registerCallbackHandler = function(callbackName) {
Expand Down
2 changes: 1 addition & 1 deletion AdjustTests/AdjustUnitTests/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.29.1";
self.clientSdk = @"ios4.29.2";
self.suffix = @"";
self.environment = @"sandbox";

Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Version 4.29.2 (12th May 2021)
#### Added
- [beta] Added data residency support for US region. You can choose this setting by calling `setUrlStrategy:` method of `ADJConfig` instance with `ADJDataResidencyUS` parameter.
- Added helper class `ADJLinkResolution` to assist with resolution of links which are wrapping Adjust deep link.

#### Fixed
- Removed 5 decimal places formatting for ad revenue value.

---

### Version 4.29.1 (28th April 2021)
#### Fixed
- Fixed missing header error for SPM users from v4.29.0.
Expand All @@ -7,7 +17,7 @@
### Version 4.29.0 (27th April 2021)
#### Added
- Added `adjustConversionValueUpdated:` callback which can be used to get information when Adjust SDK updates conversion value for the user.
- [beta] Added data residency support for Turkey region. You can choose this setting by calling `setUrlStrategy:` method of `ADJConfig` instance with `AdjustConfig.ADJDataResidencyTR` parameter.
- [beta] Added data residency support for Turkey region. You can choose this setting by calling `setUrlStrategy:` method of `ADJConfig` instance with `ADJDataResidencyTR` parameter.
- Added `trackAdRevenue:` method to `Adjust` interface to allow tracking of ad revenue by passing `ADJAdRevenue` object as parameter.
- Added support for `AppLovin MAX` ad revenue tracking.

Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
* [Deep linking on iOS 9 and later](#deeplinking-setup-new)
* [Deferred deep linking scenario](#deeplinking-deferred)
* [Reattribution via deep links](#deeplinking-reattribution)
* [Link resolution](#link-resolution)
* [[beta] Data residency](#data-residency)
* [Troubleshooting](#troubleshooting)
* [Issues with delayed SDK initialisation](#ts-delayed-init)
Expand All @@ -85,13 +86,13 @@ We will describe the steps to integrate the Adjust SDK into your iOS project. We
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.29.1'
pod 'Adjust', '~> 4.29.2'
```

or:

```ruby
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.29.1'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.29.2'
```

---
Expand Down Expand Up @@ -1067,13 +1068,40 @@ The call to `appWillOpenUrl` should be done like this to support deep linking re
}
```

### <a id="link-resolution"></a>Link resolution

If you are serving deep links from an Email Service Provider (ESP) and need to track clicks through a custom tracking link, you can use the `resolveLinkWithUrl` method of the `ADJLinkResolution` class to resolve the link. This ensures that you record the interaction with your email tracking campaigns when a deep link is opened in your application.

The `resolveLinkWithUrl` method takes the following parameters:

- `url` - the deep link that opened the application
- `resolveUrlSuffixArray` - the custom domains of the configured campaigns that need to be resolved
- `callback` - the callback that will contain the final URL

If the link received does not belong to any of the domains specified in the `resolveUrlSuffixArray`, the callback will forward the deep link URL as is. If the link does contain one of the domains specified, the SDK will attempt to resolve the link and return the resulting deep link to the `callback` parameter. The returned deep link can also be reattributed in the Adjust SDK using the `[Adjust appWillOpenUrl:]` method.

> **Note**: The SDK will automatically follow up to ten redirects when attempting to resolve the URL. It will return the latest URL it has followed as the `callback` URL, meaning that if there are more than ten redirects to follow the **tenth redirect URL** will be returned.
**Example**

```objc
[ADJLinkResolution
resolveLinkWithUrl:url
resolveUrlSuffixArray:@[@"example.com"]
callback:^(NSURL * _Nullable resolvedLink)
{
[Adjust appWillOpenUrl:resolvedLink];
}];
```
### <a id="data-residency"></a>[beta] Data residency
In order to enable data residency feature, make sure to make a call to `setUrlStrategy:` method of the `ADJConfig` instance with one of the following constants:
```objc
[adjustConfig setUrlStrategy:ADJDataResidencyEU]; // for EU data residency region
[adjustConfig setUrlStrategy:ADJDataResidencyTR]; // for Turkey data residency region
[adjustConfig setUrlStrategy:ADJDataResidencyUS]; // for US data residency region
```

**Note:** This feature is currently in beta testing phase. If you are interested in getting access to it, please contact your dedicated account manager or write an email to [email protected]. Please, do not turn this setting on before making sure with the support team that this feature is enabled for your app because otherwise SDK traffic will get dropped.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.29.1
4.29.2
Loading

0 comments on commit e79ef64

Please sign in to comment.